Class v1.AppHubClient (0.1.0)

The App Hub API allows you to manage App Hub resources. v1

Package

@google-cloud/apphub

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of AppHubClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new AppHubClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

appHubStub

appHubStub?: Promise<{
        [name: string]: Function;
    }>;

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

locationsClient

locationsClient: LocationsClient;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

applicationPath(project, location, application)

applicationPath(project: string, location: string, application: string): string;

Return a fully-qualified application resource name string.

Parameters
NameDescription
project string
location string
application string
Returns
TypeDescription
string

{string} Resource name string.

cancelOperation(request, options, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
NameDescription
request CancelOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkCreateApplicationProgress(name)

checkCreateApplicationProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.Application, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by createApplication().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.Application, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location to create Application in.
   *  Expected format: `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Application identifier.
   *  Must contain only lowercase letters, numbers
   *  or hyphens, with the first character a letter, the last a letter or a
   *  number, and a 63 character maximum.
   */
  // const applicationId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const application = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateApplication() {
    // Construct request
    const request = {
      parent,
      applicationId,
      application,
    };

    // Run request
    const [operation] = await apphubClient.createApplication(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateApplication();

checkCreateServiceProgress(name)

checkCreateServiceProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.Service, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by createService().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.Service, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the parent Application to create the
   *  Service in. Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Service identifier.
   *  Must contain only lowercase letters, numbers
   *  or hyphens, with the first character a letter, the last a letter or a
   *  number, and a 63 character maximum.
   */
  // const serviceId = 'abc123'
  /**
   *  Required. The resource being created.
   */
  // const service = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateService() {
    // Construct request
    const request = {
      parent,
      serviceId,
      service,
    };

    // Run request
    const [operation] = await apphubClient.createService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateService();

checkCreateServiceProjectAttachmentProgress(name)

checkCreateServiceProjectAttachmentProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.ServiceProjectAttachment, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by createServiceProjectAttachment().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.ServiceProjectAttachment, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Host project ID and location to which service project is being
   *  attached. Only global location is supported. Expected format:
   *  `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The service project attachment identifier must contain the
   *  project id of the service project specified in the
   *  service_project_attachment.service_project field.
   */
  // const serviceProjectAttachmentId = 'abc123'
  /**
   *  Required. The resource being created.
   */
  // const serviceProjectAttachment = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateServiceProjectAttachment() {
    // Construct request
    const request = {
      parent,
      serviceProjectAttachmentId,
      serviceProjectAttachment,
    };

    // Run request
    const [operation] = await apphubClient.createServiceProjectAttachment(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateServiceProjectAttachment();

checkCreateWorkloadProgress(name)

checkCreateWorkloadProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.Workload, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by createWorkload().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.Workload, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Application to create Workload in.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Workload identifier.
   *  Must contain only lowercase letters, numbers
   *  or hyphens, with the first character a letter, the last a letter or a
   *  number, and a 63 character maximum.
   */
  // const workloadId = 'abc123'
  /**
   *  Required. The resource being created.
   */
  // const workload = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateWorkload() {
    // Construct request
    const request = {
      parent,
      workloadId,
      workload,
    };

    // Run request
    const [operation] = await apphubClient.createWorkload(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateWorkload();

checkDeleteApplicationProgress(name)

checkDeleteApplicationProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by deleteApplication().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Application to delete.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteApplication() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteApplication(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteApplication();

checkDeleteServiceProgress(name)

checkDeleteServiceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by deleteService().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Service to delete from an
   *  Application. Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteService() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteService();

checkDeleteServiceProjectAttachmentProgress(name)

checkDeleteServiceProjectAttachmentProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by deleteServiceProjectAttachment().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the service project attachment to delete.
   *  Expected format:
   *  `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteServiceProjectAttachment() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteServiceProjectAttachment(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteServiceProjectAttachment();

checkDeleteWorkloadProgress(name)

checkDeleteWorkloadProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by deleteWorkload().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Workload to delete from an
   *  Application. Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteWorkload() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteWorkload(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteWorkload();

checkUpdateApplicationProgress(name)

checkUpdateApplicationProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.Application, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by updateApplication().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.Application, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Field mask is used to specify the fields to be overwritten in the
   *  Application resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request.
   *  The API changes the values of the fields as specified in the update_mask.
   *  The API ignores the values of all fields not covered by the update_mask.
   *  You can also unset a field by not specifying it in the updated message, but
   *  adding the field to the mask. This clears whatever value the field
   *  previously had.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated.
   */
  // const application = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callUpdateApplication() {
    // Construct request
    const request = {
      updateMask,
      application,
    };

    // Run request
    const [operation] = await apphubClient.updateApplication(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateApplication();

checkUpdateServiceProgress(name)

checkUpdateServiceProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.Service, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by updateService().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.Service, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Field mask is used to specify the fields to be overwritten in the
   *  Service resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request.
   *  The API changes the values of the fields as specified in the update_mask.
   *  The API ignores the values of all fields not covered by the update_mask.
   *  You can also unset a field by not specifying it in the updated message, but
   *  adding the field to the mask. This clears whatever value the field
   *  previously had.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated.
   */
  // const service = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callUpdateService() {
    // Construct request
    const request = {
      updateMask,
      service,
    };

    // Run request
    const [operation] = await apphubClient.updateService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateService();

checkUpdateWorkloadProgress(name)

checkUpdateWorkloadProgress(name: string): Promise<LROperation<protos.google.cloud.apphub.v1.Workload, protos.google.cloud.apphub.v1.OperationMetadata>>;

Check the status of the long running operation returned by updateWorkload().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.apphub.v1.Workload, protos.google.cloud.apphub.v1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Field mask is used to specify the fields to be overwritten in the
   *  Workload resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request.
   *  The API changes the values of the fields as specified in the update_mask.
   *  The API ignores the values of all fields not covered by the update_mask.
   *  You can also unset a field by not specifying it in the updated message, but
   *  adding the field to the mask. This clears whatever value the field
   *  previously had.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated.
   */
  // const workload = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callUpdateWorkload() {
    // Construct request
    const request = {
      updateMask,
      workload,
    };

    // Run request
    const [operation] = await apphubClient.updateWorkload(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateWorkload();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createApplication(request, options)

createApplication(request?: protos.google.cloud.apphub.v1.ICreateApplicationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates an Application in a host project and location.

Parameters
NameDescription
request ICreateApplicationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location to create Application in.
   *  Expected format: `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Application identifier.
   *  Must contain only lowercase letters, numbers
   *  or hyphens, with the first character a letter, the last a letter or a
   *  number, and a 63 character maximum.
   */
  // const applicationId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const application = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateApplication() {
    // Construct request
    const request = {
      parent,
      applicationId,
      application,
    };

    // Run request
    const [operation] = await apphubClient.createApplication(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateApplication();

createApplication(request, options, callback)

createApplication(request: protos.google.cloud.apphub.v1.ICreateApplicationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateApplicationRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createApplication(request, callback)

createApplication(request: protos.google.cloud.apphub.v1.ICreateApplicationRequest, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateApplicationRequest
callback Callback<LROperation<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createService(request, options)

createService(request?: protos.google.cloud.apphub.v1.ICreateServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a Service in an Application.

Parameters
NameDescription
request ICreateServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the parent Application to create the
   *  Service in. Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Service identifier.
   *  Must contain only lowercase letters, numbers
   *  or hyphens, with the first character a letter, the last a letter or a
   *  number, and a 63 character maximum.
   */
  // const serviceId = 'abc123'
  /**
   *  Required. The resource being created.
   */
  // const service = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateService() {
    // Construct request
    const request = {
      parent,
      serviceId,
      service,
    };

    // Run request
    const [operation] = await apphubClient.createService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateService();

createService(request, options, callback)

createService(request: protos.google.cloud.apphub.v1.ICreateServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createService(request, callback)

createService(request: protos.google.cloud.apphub.v1.ICreateServiceRequest, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceRequest
callback Callback<LROperation<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createServiceProjectAttachment(request, options)

createServiceProjectAttachment(request?: protos.google.cloud.apphub.v1.ICreateServiceProjectAttachmentRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Attaches a service project to the host project.

Parameters
NameDescription
request ICreateServiceProjectAttachmentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Host project ID and location to which service project is being
   *  attached. Only global location is supported. Expected format:
   *  `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The service project attachment identifier must contain the
   *  project id of the service project specified in the
   *  service_project_attachment.service_project field.
   */
  // const serviceProjectAttachmentId = 'abc123'
  /**
   *  Required. The resource being created.
   */
  // const serviceProjectAttachment = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateServiceProjectAttachment() {
    // Construct request
    const request = {
      parent,
      serviceProjectAttachmentId,
      serviceProjectAttachment,
    };

    // Run request
    const [operation] = await apphubClient.createServiceProjectAttachment(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateServiceProjectAttachment();

createServiceProjectAttachment(request, options, callback)

createServiceProjectAttachment(request: protos.google.cloud.apphub.v1.ICreateServiceProjectAttachmentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceProjectAttachmentRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createServiceProjectAttachment(request, callback)

createServiceProjectAttachment(request: protos.google.cloud.apphub.v1.ICreateServiceProjectAttachmentRequest, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceProjectAttachmentRequest
callback Callback<LROperation<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkload(request, options)

createWorkload(request?: protos.google.cloud.apphub.v1.ICreateWorkloadRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a Workload in an Application.

Parameters
NameDescription
request ICreateWorkloadRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Application to create Workload in.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Workload identifier.
   *  Must contain only lowercase letters, numbers
   *  or hyphens, with the first character a letter, the last a letter or a
   *  number, and a 63 character maximum.
   */
  // const workloadId = 'abc123'
  /**
   *  Required. The resource being created.
   */
  // const workload = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callCreateWorkload() {
    // Construct request
    const request = {
      parent,
      workloadId,
      workload,
    };

    // Run request
    const [operation] = await apphubClient.createWorkload(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateWorkload();

createWorkload(request, options, callback)

createWorkload(request: protos.google.cloud.apphub.v1.ICreateWorkloadRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkloadRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkload(request, callback)

createWorkload(request: protos.google.cloud.apphub.v1.ICreateWorkloadRequest, callback: Callback<LROperation<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkloadRequest
callback Callback<LROperation<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteApplication(request, options)

deleteApplication(request?: protos.google.cloud.apphub.v1.IDeleteApplicationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes an Application in a host project and location.

Parameters
NameDescription
request IDeleteApplicationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Application to delete.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteApplication() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteApplication(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteApplication();

deleteApplication(request, options, callback)

deleteApplication(request: protos.google.cloud.apphub.v1.IDeleteApplicationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteApplicationRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteApplication(request, callback)

deleteApplication(request: protos.google.cloud.apphub.v1.IDeleteApplicationRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteApplicationRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteOperation(request, options, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
NameDescription
request DeleteOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

deleteService(request, options)

deleteService(request?: protos.google.cloud.apphub.v1.IDeleteServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a Service from an Application.

Parameters
NameDescription
request IDeleteServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Service to delete from an
   *  Application. Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteService() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteService();

deleteService(request, options, callback)

deleteService(request: protos.google.cloud.apphub.v1.IDeleteServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteServiceRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteService(request, callback)

deleteService(request: protos.google.cloud.apphub.v1.IDeleteServiceRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteServiceRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteServiceProjectAttachment(request, options)

deleteServiceProjectAttachment(request?: protos.google.cloud.apphub.v1.IDeleteServiceProjectAttachmentRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a service project attachment.

Parameters
NameDescription
request IDeleteServiceProjectAttachmentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the service project attachment to delete.
   *  Expected format:
   *  `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteServiceProjectAttachment() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteServiceProjectAttachment(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteServiceProjectAttachment();

deleteServiceProjectAttachment(request, options, callback)

deleteServiceProjectAttachment(request: protos.google.cloud.apphub.v1.IDeleteServiceProjectAttachmentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteServiceProjectAttachmentRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteServiceProjectAttachment(request, callback)

deleteServiceProjectAttachment(request: protos.google.cloud.apphub.v1.IDeleteServiceProjectAttachmentRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteServiceProjectAttachmentRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkload(request, options)

deleteWorkload(request?: protos.google.cloud.apphub.v1.IDeleteWorkloadRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a Workload from an Application.

Parameters
NameDescription
request IDeleteWorkloadRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Workload to delete from an
   *  Application. Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDeleteWorkload() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await apphubClient.deleteWorkload(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteWorkload();

deleteWorkload(request, options, callback)

deleteWorkload(request: protos.google.cloud.apphub.v1.IDeleteWorkloadRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkloadRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkload(request, callback)

deleteWorkload(request: protos.google.cloud.apphub.v1.IDeleteWorkloadRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkloadRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.apphub.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

detachServiceProjectAttachment(request, options)

detachServiceProjectAttachment(request?: protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse,
        (protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest | undefined),
        {} | undefined
    ]>;

Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.

Parameters
NameDescription
request IDetachServiceProjectAttachmentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, (protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DetachServiceProjectAttachmentResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Service project id and location to detach from a host project.
   *  Only global location is supported. Expected format:
   *  `projects/{project}/locations/{location}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callDetachServiceProjectAttachment() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.detachServiceProjectAttachment(request);
    console.log(response);
  }

  callDetachServiceProjectAttachment();

detachServiceProjectAttachment(request, options, callback)

detachServiceProjectAttachment(request: protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDetachServiceProjectAttachmentRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

detachServiceProjectAttachment(request, callback)

detachServiceProjectAttachment(request: protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest, callback: Callback<protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDetachServiceProjectAttachmentRequest
callback Callback<protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

discoveredServicePath(project, location, discoveredService)

discoveredServicePath(project: string, location: string, discoveredService: string): string;

Return a fully-qualified discoveredService resource name string.

Parameters
NameDescription
project string
location string
discoveredService string
Returns
TypeDescription
string

{string} Resource name string.

discoveredWorkloadPath(project, location, discoveredWorkload)

discoveredWorkloadPath(project: string, location: string, discoveredWorkload: string): string;

Return a fully-qualified discoveredWorkload resource name string.

Parameters
NameDescription
project string
location string
discoveredWorkload string
Returns
TypeDescription
string

{string} Resource name string.

getApplication(request, options)

getApplication(request?: protos.google.cloud.apphub.v1.IGetApplicationRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IApplication,
        protos.google.cloud.apphub.v1.IGetApplicationRequest | undefined,
        {} | undefined
    ]>;

Gets an Application in a host project and location.

Parameters
NameDescription
request IGetApplicationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IGetApplicationRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Application to fetch.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callGetApplication() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.getApplication(request);
    console.log(response);
  }

  callGetApplication();

getApplication(request, options, callback)

getApplication(request: protos.google.cloud.apphub.v1.IGetApplicationRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IGetApplicationRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetApplicationRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IGetApplicationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getApplication(request, callback)

getApplication(request: protos.google.cloud.apphub.v1.IGetApplicationRequest, callback: Callback<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IGetApplicationRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetApplicationRequest
callback Callback<protos.google.cloud.apphub.v1.IApplication, protos.google.cloud.apphub.v1.IGetApplicationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getDiscoveredService(request, options)

getDiscoveredService(request?: protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IDiscoveredService,
        protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest | undefined,
        {} | undefined
    ]>;

Gets a Discovered Service in a host project and location.

Parameters
NameDescription
request IGetDiscoveredServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IDiscoveredService, protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DiscoveredService. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Discovered Service to fetch.
   *  Expected format:
   *  `projects/{project}/locations/{location}/discoveredServices/{discoveredService}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callGetDiscoveredService() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.getDiscoveredService(request);
    console.log(response);
  }

  callGetDiscoveredService();

getDiscoveredService(request, options, callback)

getDiscoveredService(request: protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IDiscoveredService, protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetDiscoveredServiceRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IDiscoveredService, protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getDiscoveredService(request, callback)

getDiscoveredService(request: protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest, callback: Callback<protos.google.cloud.apphub.v1.IDiscoveredService, protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetDiscoveredServiceRequest
callback Callback<protos.google.cloud.apphub.v1.IDiscoveredService, protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getDiscoveredWorkload(request, options)

getDiscoveredWorkload(request?: protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IDiscoveredWorkload,
        protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest | undefined,
        {} | undefined
    ]>;

Gets a Discovered Workload in a host project and location.

Parameters
NameDescription
request IGetDiscoveredWorkloadRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IDiscoveredWorkload, protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DiscoveredWorkload. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Discovered Workload to fetch.
   *  Expected format:
   *  `projects/{project}/locations/{location}/discoveredWorkloads/{discoveredWorkload}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callGetDiscoveredWorkload() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.getDiscoveredWorkload(request);
    console.log(response);
  }

  callGetDiscoveredWorkload();

getDiscoveredWorkload(request, options, callback)

getDiscoveredWorkload(request: protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IDiscoveredWorkload, protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetDiscoveredWorkloadRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IDiscoveredWorkload, protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getDiscoveredWorkload(request, callback)

getDiscoveredWorkload(request: protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest, callback: Callback<protos.google.cloud.apphub.v1.IDiscoveredWorkload, protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetDiscoveredWorkloadRequest
callback Callback<protos.google.cloud.apphub.v1.IDiscoveredWorkload, protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

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

Parameters
NameDescription
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
NameDescription
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
Promise<google.cloud.location.ILocation>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

const [response] = await client.getLocation(request);

getOperation(request, options, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

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.

Parameters
NameDescription
request GetOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

getService(request, options)

getService(request?: protos.google.cloud.apphub.v1.IGetServiceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IService,
        protos.google.cloud.apphub.v1.IGetServiceRequest | undefined,
        {} | undefined
    ]>;

Gets a Service in an Application.

Parameters
NameDescription
request IGetServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IGetServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Service to fetch.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callGetService() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.getService(request);
    console.log(response);
  }

  callGetService();

getService(request, options, callback)

getService(request: protos.google.cloud.apphub.v1.IGetServiceRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IGetServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getService(request, callback)

getService(request: protos.google.cloud.apphub.v1.IGetServiceRequest, callback: Callback<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IGetServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceRequest
callback Callback<protos.google.cloud.apphub.v1.IService, protos.google.cloud.apphub.v1.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getServiceProjectAttachment(request, options)

getServiceProjectAttachment(request?: protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IServiceProjectAttachment,
        (protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest | undefined),
        {} | undefined
    ]>;

Gets a service project attachment.

Parameters
NameDescription
request IGetServiceProjectAttachmentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IServiceProjectAttachment, (protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the service project attachment to
   *  retrieve. Expected format:
   *  `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callGetServiceProjectAttachment() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.getServiceProjectAttachment(request);
    console.log(response);
  }

  callGetServiceProjectAttachment();

getServiceProjectAttachment(request, options, callback)

getServiceProjectAttachment(request: protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceProjectAttachmentRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getServiceProjectAttachment(request, callback)

getServiceProjectAttachment(request: protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest, callback: Callback<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceProjectAttachmentRequest
callback Callback<protos.google.cloud.apphub.v1.IServiceProjectAttachment, protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkload(request, options)

getWorkload(request?: protos.google.cloud.apphub.v1.IGetWorkloadRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IWorkload,
        protos.google.cloud.apphub.v1.IGetWorkloadRequest | undefined,
        {} | undefined
    ]>;

Gets a Workload in an Application.

Parameters
NameDescription
request IGetWorkloadRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IGetWorkloadRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Fully qualified name of the Workload to fetch.
   *  Expected format:
   *  `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
   */
  // const name = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callGetWorkload() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await apphubClient.getWorkload(request);
    console.log(response);
  }

  callGetWorkload();

getWorkload(request, options, callback)

getWorkload(request: protos.google.cloud.apphub.v1.IGetWorkloadRequest, options: CallOptions, callback: Callback<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkloadRequest
options CallOptions
callback Callback<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkload(request, callback)

getWorkload(request: protos.google.cloud.apphub.v1.IGetWorkloadRequest, callback: Callback<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkloadRequest
callback Callback<protos.google.cloud.apphub.v1.IWorkload, protos.google.cloud.apphub.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listApplications(request, options)

listApplications(request?: protos.google.cloud.apphub.v1.IListApplicationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IApplication[],
        protos.google.cloud.apphub.v1.IListApplicationsRequest | null,
        protos.google.cloud.apphub.v1.IListApplicationsResponse
    ]>;

Lists Applications in a host project and location.

Parameters
NameDescription
request IListApplicationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IApplication[], protos.google.cloud.apphub.v1.IListApplicationsRequest | null, protos.google.cloud.apphub.v1.IListApplicationsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listApplicationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listApplications(request, options, callback)

listApplications(request: protos.google.cloud.apphub.v1.IListApplicationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListApplicationsRequest, protos.google.cloud.apphub.v1.IListApplicationsResponse | null | undefined, protos.google.cloud.apphub.v1.IApplication>): void;
Parameters
NameDescription
request IListApplicationsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.apphub.v1.IListApplicationsRequest, protos.google.cloud.apphub.v1.IListApplicationsResponse | null | undefined, protos.google.cloud.apphub.v1.IApplication>
Returns
TypeDescription
void

listApplications(request, callback)

listApplications(request: protos.google.cloud.apphub.v1.IListApplicationsRequest, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListApplicationsRequest, protos.google.cloud.apphub.v1.IListApplicationsResponse | null | undefined, protos.google.cloud.apphub.v1.IApplication>): void;
Parameters
NameDescription
request IListApplicationsRequest
callback PaginationCallback<protos.google.cloud.apphub.v1.IListApplicationsRequest, protos.google.cloud.apphub.v1.IListApplicationsResponse | null | undefined, protos.google.cloud.apphub.v1.IApplication>
Returns
TypeDescription
void

listApplicationsAsync(request, options)

listApplicationsAsync(request?: protos.google.cloud.apphub.v1.IListApplicationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.apphub.v1.IApplication>;

Equivalent to listApplications, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListApplicationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.apphub.v1.IApplication>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location to list Applications on.
   *  Expected format: `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results.
   */
  // const orderBy = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callListApplications() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = apphubClient.listApplicationsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListApplications();

listApplicationsStream(request, options)

listApplicationsStream(request?: protos.google.cloud.apphub.v1.IListApplicationsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListApplicationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listApplicationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDiscoveredServices(request, options)

listDiscoveredServices(request?: protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IDiscoveredService[],
        protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest | null,
        protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse
    ]>;

Lists Discovered Services that can be added to an Application in a host project and location.

Parameters
NameDescription
request IListDiscoveredServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IDiscoveredService[], protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest | null, protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of DiscoveredService. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listDiscoveredServicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDiscoveredServices(request, options, callback)

listDiscoveredServices(request: protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredService>): void;
Parameters
NameDescription
request IListDiscoveredServicesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredService>
Returns
TypeDescription
void

listDiscoveredServices(request, callback)

listDiscoveredServices(request: protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredService>): void;
Parameters
NameDescription
request IListDiscoveredServicesRequest
callback PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredService>
Returns
TypeDescription
void

listDiscoveredServicesAsync(request, options)

listDiscoveredServicesAsync(request?: protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.apphub.v1.IDiscoveredService>;

Equivalent to listDiscoveredServices, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListDiscoveredServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.apphub.v1.IDiscoveredService>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing DiscoveredService. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location to list Discovered Services on.
   *  Expected format: `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results.
   */
  // const orderBy = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callListDiscoveredServices() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = apphubClient.listDiscoveredServicesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListDiscoveredServices();

listDiscoveredServicesStream(request, options)

listDiscoveredServicesStream(request?: protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListDiscoveredServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing DiscoveredService on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDiscoveredServicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDiscoveredWorkloads(request, options)

listDiscoveredWorkloads(request?: protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IDiscoveredWorkload[],
        protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest | null,
        protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse
    ]>;

Lists Discovered Workloads that can be added to an Application in a host project and location.

Parameters
NameDescription
request IListDiscoveredWorkloadsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IDiscoveredWorkload[], protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest | null, protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of DiscoveredWorkload. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listDiscoveredWorkloadsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDiscoveredWorkloads(request, options, callback)

listDiscoveredWorkloads(request: protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredWorkload>): void;
Parameters
NameDescription
request IListDiscoveredWorkloadsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredWorkload>
Returns
TypeDescription
void

listDiscoveredWorkloads(request, callback)

listDiscoveredWorkloads(request: protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredWorkload>): void;
Parameters
NameDescription
request IListDiscoveredWorkloadsRequest
callback PaginationCallback<protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse | null | undefined, protos.google.cloud.apphub.v1.IDiscoveredWorkload>
Returns
TypeDescription
void

listDiscoveredWorkloadsAsync(request, options)

listDiscoveredWorkloadsAsync(request?: protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.apphub.v1.IDiscoveredWorkload>;

Equivalent to listDiscoveredWorkloads, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListDiscoveredWorkloadsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.apphub.v1.IDiscoveredWorkload>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing DiscoveredWorkload. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location to list Discovered Workloads on.
   *  Expected format: `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results.
   */
  // const orderBy = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callListDiscoveredWorkloads() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = apphubClient.listDiscoveredWorkloadsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListDiscoveredWorkloads();

listDiscoveredWorkloadsStream(request, options)

listDiscoveredWorkloadsStream(request?: protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListDiscoveredWorkloadsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing DiscoveredWorkload on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDiscoveredWorkloadsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<google.cloud.location.ILocation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}

listOperationsAsync(request, options)

listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;

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

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
NameDescription
request ListOperationsRequest

The request object that will be sent.

options CallOptions

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns
TypeDescription
AsyncIterable<protos.google.longrunning.ListOperationsResponse>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

listServiceProjectAttachments(request, options)

listServiceProjectAttachments(request?: protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IServiceProjectAttachment[],
        protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest | null,
        protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse
    ]>;

Lists service projects attached to the host project.

Parameters
NameDescription
request IListServiceProjectAttachmentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IServiceProjectAttachment[], protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest | null, protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listServiceProjectAttachmentsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServiceProjectAttachments(request, options, callback)

listServiceProjectAttachments(request: protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse | null | undefined, protos.google.cloud.apphub.v1.IServiceProjectAttachment>): void;
Parameters
NameDescription
request IListServiceProjectAttachmentsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse | null | undefined, protos.google.cloud.apphub.v1.IServiceProjectAttachment>
Returns
TypeDescription
void

listServiceProjectAttachments(request, callback)

listServiceProjectAttachments(request: protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, callback: PaginationCallback<protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse | null | undefined, protos.google.cloud.apphub.v1.IServiceProjectAttachment>): void;
Parameters
NameDescription
request IListServiceProjectAttachmentsRequest
callback PaginationCallback<protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse | null | undefined, protos.google.cloud.apphub.v1.IServiceProjectAttachment>
Returns
TypeDescription
void

listServiceProjectAttachmentsAsync(request, options)

listServiceProjectAttachmentsAsync(request?: protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.apphub.v1.IServiceProjectAttachment>;

Equivalent to listServiceProjectAttachments, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListServiceProjectAttachmentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.apphub.v1.IServiceProjectAttachment>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Host project ID and location to list service project attachments.
   *  Only global location is supported. Expected format:
   *  `projects/{project}/locations/{location}`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results.
   */
  // const orderBy = 'abc123'

  // Imports the Apphub library
  const {AppHubClient} = require('@google-cloud/apphub').v1;

  // Instantiates a client
  const apphubClient = new AppHubClient();

  async function callListServiceProjectAttachments() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = apphubClient.listServiceProjectAttachmentsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListServiceProjectAttachments();

listServiceProjectAttachmentsStream(request, options)

listServiceProjectAttachmentsStream(request?: protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListServiceProjectAttachmentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listServiceProjectAttachmentsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServices(request, options)

listServices(request?: protos.google.cloud.apphub.v1.IListServicesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.apphub.v1.IService[],
        protos.google.cloud.apphub.v1.IListServicesRequest | null,
        protos.google.cloud.apphub.v1.IListServicesResponse
    ]>;

Lists Services in an Application.

Parameters
NameDescription
request IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.apphub.v1.IService[], protos.google.cloud.apphub.v1.IListServicesRequest | null, protos.google.cloud.apphub.v1.IListServicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listServicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServices(request, options, callback)

listServices(request: protos.google.cloud.apphub.v1.IListServicesRequest