Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

CloudFunctions

import { CloudFunctions } from "https://googleapis.deno.dev/v1/cloudfunctions:v2.ts";

Manages lightweight user-provided functions executed in response to events.

class CloudFunctions {
constructor(client?: CredentialsClient, baseUrl?: string);
locations;
locations;
locations;
locations;
locations;
 
async projectsLocationsFunctionsAbortFunctionUpgrade(name: string, req: AbortFunctionUpgradeRequest): Promise<Operation>;
async projectsLocationsFunctionsCommitFunctionUpgrade(name: string, req: CommitFunctionUpgradeRequest): Promise<Operation>;
async projectsLocationsFunctionsCreate(
parent: string,
req: Function,
): Promise<Operation>;
async projectsLocationsFunctionsDelete(name: string): Promise<Operation>;
async projectsLocationsFunctionsGenerateDownloadUrl(name: string, req: GenerateDownloadUrlRequest): Promise<GenerateDownloadUrlResponse>;
async projectsLocationsFunctionsGenerateUploadUrl(parent: string, req: GenerateUploadUrlRequest): Promise<GenerateUploadUrlResponse>;
async projectsLocationsFunctionsGet(name: string, opts?: ProjectsLocationsFunctionsGetOptions): Promise<Function>;
async projectsLocationsFunctionsGetIamPolicy(resource: string, opts?: ProjectsLocationsFunctionsGetIamPolicyOptions): Promise<Policy>;
async projectsLocationsFunctionsList(parent: string, opts?: ProjectsLocationsFunctionsListOptions): Promise<ListFunctionsResponse>;
async projectsLocationsFunctionsPatch(
name: string,
req: Function,
): Promise<Operation>;
async projectsLocationsFunctionsRedirectFunctionUpgradeTraffic(name: string, req: RedirectFunctionUpgradeTrafficRequest): Promise<Operation>;
async projectsLocationsFunctionsRollbackFunctionUpgradeTraffic(name: string, req: RollbackFunctionUpgradeTrafficRequest): Promise<Operation>;
async projectsLocationsFunctionsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>;
async projectsLocationsFunctionsSetupFunctionUpgradeConfig(name: string, req: SetupFunctionUpgradeConfigRequest): Promise<Operation>;
async projectsLocationsFunctionsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>;
async projectsLocationsList(name: string, opts?: ProjectsLocationsListOptions): Promise<ListLocationsResponse>;
async projectsLocationsOperationsGet(name: string): Promise<Operation>;
async projectsLocationsOperationsList(name: string, opts?: ProjectsLocationsOperationsListOptions): Promise<ListOperationsResponse>;
async projectsLocationsRuntimesList(parent: string, opts?: ProjectsLocationsRuntimesListOptions): Promise<ListRuntimesResponse>;
}

§Constructors

§
new CloudFunctions(client?: CredentialsClient, baseUrl?: string)
[src]

§Properties

§
locations
[src]

Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return ALREADY_EXISTS error.

§
locations
[src]

Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, specify this header: * content-type: application/zip Do not specify this header: * Authorization: Bearer YOUR_TOKEN

§
locations
[src]

Returns a list of functions that belong to the requested project.

§
locations
[src]

Updates existing function.

§
locations
[src]

Returns a list of runtimes that are supported for the requested project.

§Methods

§
projectsLocationsFunctionsAbortFunctionUpgrade(name: string, req: AbortFunctionUpgradeRequest): Promise<Operation>
[src]

Aborts generation upgrade process for a function with the given name from the specified project. Deletes all 2nd Gen copy related configuration and resources which were created during the upgrade process.

@param name

Required. The name of the function for which upgrade should be aborted.

§
projectsLocationsFunctionsCommitFunctionUpgrade(name: string, req: CommitFunctionUpgradeRequest): Promise<Operation>
[src]

Finalizes the upgrade after which function upgrade can not be rolled back. This is the last step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Deletes all original 1st Gen related configuration and resources.

@param name

Required. The name of the function for which upgrade should be finalized.

§
projectsLocationsFunctionsCreate(parent: string, req: Function, opts?: ProjectsLocationsFunctionsCreateOptions): Promise<Operation>
[src]
§
projectsLocationsFunctionsDelete(name: string): Promise<Operation>
[src]

Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function.

@param name

Required. The name of the function which should be deleted.

§
projectsLocationsFunctionsGenerateDownloadUrl(name: string, req: GenerateDownloadUrlRequest): Promise<GenerateDownloadUrlResponse>
[src]

Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within 30 minutes of generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls

@param name

Required. The name of function for which source code Google Cloud Storage signed URL should be generated.

§
projectsLocationsFunctionsGenerateUploadUrl(parent: string, req: GenerateUploadUrlRequest): Promise<GenerateUploadUrlResponse>
[src]
§
projectsLocationsFunctionsGet(name: string, opts?: ProjectsLocationsFunctionsGetOptions): Promise<Function>
[src]

Returns a function with the given name from the requested project.

@param name

Required. The name of the function which details should be obtained.

§
projectsLocationsFunctionsGetIamPolicy(resource: string, opts?: ProjectsLocationsFunctionsGetIamPolicyOptions): Promise<Policy>
[src]

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

@param resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

§
projectsLocationsFunctionsList(parent: string, opts?: ProjectsLocationsFunctionsListOptions): Promise<ListFunctionsResponse>
[src]
§
projectsLocationsFunctionsPatch(name: string, req: Function, opts?: ProjectsLocationsFunctionsPatchOptions): Promise<Operation>
[src]
§
projectsLocationsFunctionsRedirectFunctionUpgradeTraffic(name: string, req: RedirectFunctionUpgradeTrafficRequest): Promise<Operation>
[src]

Changes the traffic target of a function from the original 1st Gen function to the 2nd Gen copy. This is the second step of the multi step process to upgrade 1st Gen functions to 2nd Gen. After this operation, all new traffic will be served by 2nd Gen copy.

@param name

Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.

§
projectsLocationsFunctionsRollbackFunctionUpgradeTraffic(name: string, req: RollbackFunctionUpgradeTrafficRequest): Promise<Operation>
[src]

Reverts the traffic target of a function from the 2nd Gen copy to the original 1st Gen function. After this operation, all new traffic would be served by the 1st Gen.

@param name

Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.

§
projectsLocationsFunctionsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>
[src]

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

@param resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

§
projectsLocationsFunctionsSetupFunctionUpgradeConfig(name: string, req: SetupFunctionUpgradeConfigRequest): Promise<Operation>
[src]

Creates a 2nd Gen copy of the function configuration based on the 1st Gen function with the given name. This is the first step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Only 2nd Gen configuration is setup as part of this request and traffic continues to be served by 1st Gen.

@param name

Required. The name of the function which should have configuration copied for upgrade.

§
projectsLocationsFunctionsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>
[src]

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

@param resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

§
projectsLocationsList(name: string, opts?: ProjectsLocationsListOptions): Promise<ListLocationsResponse>
[src]

Lists information about the supported locations for this service.

@param name

The resource that owns the locations collection, if applicable.

§
projectsLocationsOperationsGet(name: string): Promise<Operation>
[src]

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

@param name

The name of the operation resource.

§
projectsLocationsOperationsList(name: string, opts?: ProjectsLocationsOperationsListOptions): Promise<ListOperationsResponse>
[src]

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.

@param name

The name of the operation's parent resource.

§
projectsLocationsRuntimesList(parent: string, opts?: ProjectsLocationsRuntimesListOptions): Promise<ListRuntimesResponse>
[src]