Class v1.ServiceManagerClient (2.2.0)

Package

@google-cloud/service-management

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of ServiceManagerClient.

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 ServiceManagerClient({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.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

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.

serviceManagerStub

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

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

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: ''});

checkCreateServiceProgress(name)

checkCreateServiceProgress(name: string): Promise<LROperation<protos.google.api.servicemanagement.v1.ManagedService, protos.google.api.servicemanagement.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.api.servicemanagement.v1.ManagedService, protos.google.api.servicemanagement.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. Initial values for the service resource.
   */
  // const service = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

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

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

  callCreateService();

checkCreateServiceRolloutProgress(name)

checkCreateServiceRolloutProgress(name: string): Promise<LROperation<protos.google.api.servicemanagement.v1.Rollout, protos.google.api.servicemanagement.v1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.servicemanagement.v1.Rollout, protos.google.api.servicemanagement.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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The rollout resource. The `service_name` field is output only.
   */
  // const rollout = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callCreateServiceRollout() {
    // Construct request
    const request = {
      serviceName,
      rollout,
    };

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

  callCreateServiceRollout();

checkDeleteServiceProgress(name)

checkDeleteServiceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.servicemanagement.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.api.servicemanagement.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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

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

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

  callDeleteService();

checkSubmitConfigSourceProgress(name)

checkSubmitConfigSourceProgress(name: string): Promise<LROperation<protos.google.api.servicemanagement.v1.SubmitConfigSourceResponse, protos.google.api.servicemanagement.v1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.servicemanagement.v1.SubmitConfigSourceResponse, protos.google.api.servicemanagement.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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The source configuration for the service.
   */
  // const configSource = {}
  /**
   *  Optional. If set, this will result in the generation of a
   *  `google.api.Service` configuration based on the `ConfigSource` provided,
   *  but the generated config and the sources will NOT be persisted.
   */
  // const validateOnly = true

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callSubmitConfigSource() {
    // Construct request
    const request = {
      serviceName,
      configSource,
    };

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

  callSubmitConfigSource();

checkUndeleteServiceProgress(name)

checkUndeleteServiceProgress(name: string): Promise<LROperation<protos.google.api.servicemanagement.v1.UndeleteServiceResponse, protos.google.api.servicemanagement.v1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.servicemanagement.v1.UndeleteServiceResponse, protos.google.api.servicemanagement.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. The name of the service. See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements. For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callUndeleteService() {
    // Construct request
    const request = {
      serviceName,
    };

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

  callUndeleteService();

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.

createService(request, options)

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

Creates a new managed service.

A managed service is immutable, and is subject to mandatory 30-day data retention. You cannot move a service or recreate it within 30 days after deletion.

One producer project can own no more than 500 services. For security and reliability purposes, a production service should be hosted in a dedicated producer project.

Operation<response: ManagedService>

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.api.servicemanagement.v1.IManagedService, protos.google.api.servicemanagement.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. Initial values for the service resource.
   */
  // const service = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

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

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

  callCreateService();

createService(request, options, callback)

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

createService(request, callback)

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

createServiceConfig(request, options)

createServiceConfig(request?: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, options?: CallOptions): Promise<[
        protos.google.api.IService,
        (protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest | undefined),
        {} | undefined
    ]>;

Creates a new service configuration (version) for a managed service. This method only stores the service configuration. To roll out the service configuration to backend systems please call .

Only the 100 most recent service configurations and ones referenced by existing rollouts are kept for each service. The rest will be deleted eventually.

Parameters
NameDescription
request ICreateServiceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IService, (protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Service. 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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The service configuration resource.
   */
  // const serviceConfig = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callCreateServiceConfig() {
    // Construct request
    const request = {
      serviceName,
      serviceConfig,
    };

    // Run request
    const response = await servicemanagementClient.createServiceConfig(request);
    console.log(response);
  }

  callCreateServiceConfig();

createServiceConfig(request, options, callback)

createServiceConfig(request: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, options: CallOptions, callback: Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceConfigRequest
options CallOptions
callback Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createServiceConfig(request, callback)

createServiceConfig(request: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, callback: Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceConfigRequest
callback Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createServiceRollout(request, options)

createServiceRollout(request?: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new service configuration rollout. Based on rollout, the Google Service Management will roll out the service configurations to different backend services. For example, the logging configuration will be pushed to Google Cloud Logging.

Please note that any previous pending and running Rollouts and associated Operations will be automatically cancelled so that the latest Rollout will not be blocked by previous Rollouts.

Only the 100 most recent (in any state) and the last 10 successful (if not already part of the set of 100 most recent) rollouts are kept for each service. The rest will be deleted eventually.

Operation<response: Rollout>

Parameters
NameDescription
request ICreateServiceRolloutRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The rollout resource. The `service_name` field is output only.
   */
  // const rollout = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callCreateServiceRollout() {
    // Construct request
    const request = {
      serviceName,
      rollout,
    };

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

  callCreateServiceRollout();

createServiceRollout(request, options, callback)

createServiceRollout(request: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceRolloutRequest
options CallOptions
callback Callback<LROperation<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createServiceRollout(request, callback)

createServiceRollout(request: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, callback: Callback<LROperation<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateServiceRolloutRequest
callback Callback<LROperation<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.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.api.servicemanagement.v1.IDeleteServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.api.servicemanagement.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a managed service. This method will change the service to the Soft-Delete state for 30 days. Within this period, service producers may call to restore the service. After 30 days, the service will be permanently deleted.

Operation<response: google.protobuf.Empty>

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.api.servicemanagement.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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

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

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

  callDeleteService();

deleteService(request, options, callback)

deleteService(request: protos.google.api.servicemanagement.v1.IDeleteServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.servicemanagement.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.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteService(request, callback)

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

generateConfigReport(request, options)

generateConfigReport(request?: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, options?: CallOptions): Promise<[
        protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse,
        (protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest | undefined),
        {} | undefined
    ]>;

Generates and returns a report (errors, warnings and changes from existing configurations) associated with GenerateConfigReportRequest.new_value

If GenerateConfigReportRequest.old_value is specified, GenerateConfigReportRequest will contain a single ChangeReport based on the comparison between GenerateConfigReportRequest.new_value and GenerateConfigReportRequest.old_value. If GenerateConfigReportRequest.old_value is not specified, this method will compare GenerateConfigReportRequest.new_value with the last pushed service configuration.

Parameters
NameDescription
request IGenerateConfigReportRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, (protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing GenerateConfigReportResponse. 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 configuration for which we want to generate the report.
   *  For this version of API, the supported types are
   *  google.api.servicemanagement.v1.ConfigRef google.api.servicemanagement.v1.ConfigRef,
   *  google.api.servicemanagement.v1.ConfigSource google.api.servicemanagement.v1.ConfigSource,
   *  and google.api.Service google.api.Service 
   */
  // const newConfig = {}
  /**
   *  Optional. Service configuration against which the comparison will be done.
   *  For this version of API, the supported types are
   *  google.api.servicemanagement.v1.ConfigRef google.api.servicemanagement.v1.ConfigRef,
   *  google.api.servicemanagement.v1.ConfigSource google.api.servicemanagement.v1.ConfigSource,
   *  and google.api.Service google.api.Service 
   */
  // const oldConfig = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callGenerateConfigReport() {
    // Construct request
    const request = {
      newConfig,
    };

    // Run request
    const response = await servicemanagementClient.generateConfigReport(request);
    console.log(response);
  }

  callGenerateConfigReport();

generateConfigReport(request, options, callback)

generateConfigReport(request: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, options: CallOptions, callback: Callback<protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateConfigReportRequest
options CallOptions
callback Callback<protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateConfigReport(request, callback)

generateConfigReport(request: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, callback: Callback<protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateConfigReportRequest
callback Callback<protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest | 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.

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.api.servicemanagement.v1.IGetServiceRequest, options?: CallOptions): Promise<[
        protos.google.api.servicemanagement.v1.IManagedService,
        protos.google.api.servicemanagement.v1.IGetServiceRequest | undefined,
        {} | undefined
    ]>;

Gets a managed service. Authentication is required unless the service is public.

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.api.servicemanagement.v1.IManagedService, protos.google.api.servicemanagement.v1.IGetServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ManagedService. 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. The name of the service.  See the `ServiceManager` overview for
   *  naming requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

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

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

  callGetService();

getService(request, options, callback)

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

getService(request, callback)

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

getServiceConfig(request, options)

getServiceConfig(request?: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, options?: CallOptions): Promise<[
        protos.google.api.IService,
        (protos.google.api.servicemanagement.v1.IGetServiceConfigRequest | undefined),
        {} | undefined
    ]>;

Gets a service configuration (version) for a managed service.

Parameters
NameDescription
request IGetServiceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IService, (protos.google.api.servicemanagement.v1.IGetServiceConfigRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Service. 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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The id of the service configuration resource.
   *  This field must be specified for the server to return all fields, including
   *  `SourceInfo`.
   */
  // const configId = 'abc123'
  /**
   *  Specifies which parts of the Service Config should be returned in the
   *  response.
   */
  // const view = {}

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callGetServiceConfig() {
    // Construct request
    const request = {
      serviceName,
      configId,
    };

    // Run request
    const response = await servicemanagementClient.getServiceConfig(request);
    console.log(response);
  }

  callGetServiceConfig();

getServiceConfig(request, options, callback)

getServiceConfig(request: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, options: CallOptions, callback: Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.IGetServiceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceConfigRequest
options CallOptions
callback Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.IGetServiceConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getServiceConfig(request, callback)

getServiceConfig(request: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, callback: Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.IGetServiceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceConfigRequest
callback Callback<protos.google.api.IService, protos.google.api.servicemanagement.v1.IGetServiceConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getServiceRollout(request, options)

getServiceRollout(request?: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, options?: CallOptions): Promise<[
        protos.google.api.servicemanagement.v1.IRollout,
        (protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest | undefined),
        {} | undefined
    ]>;

Gets a service configuration .

Parameters
NameDescription
request IGetServiceRolloutRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.servicemanagement.v1.IRollout, (protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest | 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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The id of the rollout resource.
   */
  // const rolloutId = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callGetServiceRollout() {
    // Construct request
    const request = {
      serviceName,
      rolloutId,
    };

    // Run request
    const response = await servicemanagementClient.getServiceRollout(request);
    console.log(response);
  }

  callGetServiceRollout();

getServiceRollout(request, options, callback)

getServiceRollout(request: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, options: CallOptions, callback: Callback<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceRolloutRequest
options CallOptions
callback Callback<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getServiceRollout(request, callback)

getServiceRollout(request: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, callback: Callback<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceRolloutRequest
callback Callback<protos.google.api.servicemanagement.v1.IRollout, protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest | 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.

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)

listServiceConfigs(request, options)

listServiceConfigs(request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, options?: CallOptions): Promise<[
        protos.google.api.IService[],
        protos.google.api.servicemanagement.v1.IListServiceConfigsRequest | null,
        protos.google.api.servicemanagement.v1.IListServiceConfigsResponse
    ]>;

Lists the history of the service configuration for a managed service, from the newest to the oldest.

Parameters
NameDescription
request IListServiceConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IService[], protos.google.api.servicemanagement.v1.IListServiceConfigsRequest | null, protos.google.api.servicemanagement.v1.IListServiceConfigsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Service. 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 listServiceConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServiceConfigs(request, options, callback)

listServiceConfigs(request: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, protos.google.api.servicemanagement.v1.IListServiceConfigsResponse | null | undefined, protos.google.api.IService>): void;
Parameters
NameDescription
request IListServiceConfigsRequest
options CallOptions
callback PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, protos.google.api.servicemanagement.v1.IListServiceConfigsResponse | null | undefined, protos.google.api.IService>
Returns
TypeDescription
void

listServiceConfigs(request, callback)

listServiceConfigs(request: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, callback: PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, protos.google.api.servicemanagement.v1.IListServiceConfigsResponse | null | undefined, protos.google.api.IService>): void;
Parameters
NameDescription
request IListServiceConfigsRequest
callback PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, protos.google.api.servicemanagement.v1.IListServiceConfigsResponse | null | undefined, protos.google.api.IService>
Returns
TypeDescription
void

listServiceConfigsAsync(request, options)

listServiceConfigsAsync(request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.api.IService>;

Equivalent to listServiceConfigs, but returns an iterable object.

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

Parameters
NameDescription
request IListServiceConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.IService>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Service. 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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  The token of the page to retrieve.
   */
  // const pageToken = 'abc123'
  /**
   *  The max number of items to include in the response list. Page size is 50
   *  if not specified. Maximum value is 100.
   */
  // const pageSize = 1234

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callListServiceConfigs() {
    // Construct request
    const request = {
      serviceName,
    };

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

  callListServiceConfigs();

listServiceConfigsStream(request, options)

listServiceConfigsStream(request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListServiceConfigsRequest

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 Service 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 listServiceConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServiceRollouts(request, options)

listServiceRollouts(request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, options?: CallOptions): Promise<[
        protos.google.api.servicemanagement.v1.IRollout[],
        protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest | null,
        protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse
    ]>;

Lists the history of the service configuration rollouts for a managed service, from the newest to the oldest.

Parameters
NameDescription
request IListServiceRolloutsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.servicemanagement.v1.IRollout[], protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest | null, protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse ]>

{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 listServiceRolloutsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServiceRollouts(request, options, callback)

listServiceRollouts(request: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse | null | undefined, protos.google.api.servicemanagement.v1.IRollout>): void;
Parameters
NameDescription
request IListServiceRolloutsRequest
options CallOptions
callback PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse | null | undefined, protos.google.api.servicemanagement.v1.IRollout>
Returns
TypeDescription
void

listServiceRollouts(request, callback)

listServiceRollouts(request: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, callback: PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse | null | undefined, protos.google.api.servicemanagement.v1.IRollout>): void;
Parameters
NameDescription
request IListServiceRolloutsRequest
callback PaginationCallback<protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse | null | undefined, protos.google.api.servicemanagement.v1.IRollout>
Returns
TypeDescription
void

listServiceRolloutsAsync(request, options)

listServiceRolloutsAsync(request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, options?: CallOptions): AsyncIterable<protos.google.api.servicemanagement.v1.IRollout>;

Equivalent to listServiceRollouts, but returns an iterable object.

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

Parameters
NameDescription
request IListServiceRolloutsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.servicemanagement.v1.IRollout>

{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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  The token of the page to retrieve.
   */
  // const pageToken = 'abc123'
  /**
   *  The max number of items to include in the response list. Page size is 50
   *  if not specified. Maximum value is 100.
   */
  // const pageSize = 1234
  /**
   *  Required. Use `filter` to return subset of rollouts.
   *  The following filters are supported:
   *   -- By status 
   *   google.api.servicemanagement.v1.Rollout.RolloutStatus. For example,
   *   `filter='status=SUCCESS'`
   *   -- By strategy 
   *   google.api.servicemanagement.v1.Rollout.strategy. For example,
   *   `filter='strategy=TrafficPercentStrategy'`
   */
  // const filter = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callListServiceRollouts() {
    // Construct request
    const request = {
      serviceName,
      filter,
    };

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

  callListServiceRollouts();

listServiceRolloutsStream(request, options)

listServiceRolloutsStream(request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListServiceRolloutsRequest

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 listServiceRolloutsAsync() 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.api.servicemanagement.v1.IListServicesRequest, options?: CallOptions): Promise<[
        protos.google.api.servicemanagement.v1.IManagedService[],
        protos.google.api.servicemanagement.v1.IListServicesRequest | null,
        protos.google.api.servicemanagement.v1.IListServicesResponse
    ]>;

Lists managed services.

Returns all public services. For authenticated users, also returns all services the calling user has "servicemanagement.services.get" permission for.

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.api.servicemanagement.v1.IManagedService[], protos.google.api.servicemanagement.v1.IListServicesRequest | null, protos.google.api.servicemanagement.v1.IListServicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of ManagedService. 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.api.servicemanagement.v1.IListServicesRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.servicemanagement.v1.IListServicesRequest, protos.google.api.servicemanagement.v1.IListServicesResponse | null | undefined, protos.google.api.servicemanagement.v1.IManagedService>): void;
Parameters
NameDescription
request IListServicesRequest
options CallOptions
callback PaginationCallback<protos.google.api.servicemanagement.v1.IListServicesRequest, protos.google.api.servicemanagement.v1.IListServicesResponse | null | undefined, protos.google.api.servicemanagement.v1.IManagedService>
Returns
TypeDescription
void

listServices(request, callback)

listServices(request: protos.google.api.servicemanagement.v1.IListServicesRequest, callback: PaginationCallback<protos.google.api.servicemanagement.v1.IListServicesRequest, protos.google.api.servicemanagement.v1.IListServicesResponse | null | undefined, protos.google.api.servicemanagement.v1.IManagedService>): void;
Parameters
NameDescription
request IListServicesRequest
callback PaginationCallback<protos.google.api.servicemanagement.v1.IListServicesRequest, protos.google.api.servicemanagement.v1.IListServicesResponse | null | undefined, protos.google.api.servicemanagement.v1.IManagedService>
Returns
TypeDescription
void

listServicesAsync(request, options)

listServicesAsync(request?: protos.google.api.servicemanagement.v1.IListServicesRequest, options?: CallOptions): AsyncIterable<protos.google.api.servicemanagement.v1.IManagedService>;

Equivalent to listServices, but returns an iterable object.

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

Parameters
NameDescription
request IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.servicemanagement.v1.IManagedService>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ManagedService. 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.
   */
  /**
   *  Include services produced by the specified project.
   */
  // const producerProjectId = 'abc123'
  /**
   *  The max number of items to include in the response list. Page size is 50
   *  if not specified. Maximum value is 500.
   */
  // const pageSize = 1234
  /**
   *  Token identifying which result to start with; returned by a previous list
   *  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Include services consumed by the specified consumer.
   *  The Google Service Management implementation accepts the following
   *  forms:
   *  - project:

listServicesStream(request, options)

listServicesStream(request?: protos.google.api.servicemanagement.v1.IListServicesRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListServicesRequest

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 ManagedService 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 listServicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

setIamPolicy(request, options, callback)

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

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

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

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | 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.SetIamPolicyRequest | 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.

submitConfigSource(request, options)

submitConfigSource(request?: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new service configuration (version) for a managed service based on user-supplied configuration source files (for example: OpenAPI Specification). This method stores the source configurations as well as the generated service configuration. To rollout the service configuration to other services, please call .

Only the 100 most recent configuration sources and ones referenced by existing service configurtions are kept for each service. The rest will be deleted eventually.

Operation<response: SubmitConfigSourceResponse>

Parameters
NameDescription
request ISubmitConfigSourceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, protos.google.api.servicemanagement.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. The name of the service.  See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements.  For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'
  /**
   *  Required. The source configuration for the service.
   */
  // const configSource = {}
  /**
   *  Optional. If set, this will result in the generation of a
   *  `google.api.Service` configuration based on the `ConfigSource` provided,
   *  but the generated config and the sources will NOT be persisted.
   */
  // const validateOnly = true

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callSubmitConfigSource() {
    // Construct request
    const request = {
      serviceName,
      configSource,
    };

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

  callSubmitConfigSource();

submitConfigSource(request, options, callback)

submitConfigSource(request: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ISubmitConfigSourceRequest
options CallOptions
callback Callback<LROperation<protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

submitConfigSource(request, callback)

submitConfigSource(request: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, callback: Callback<LROperation<protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ISubmitConfigSourceRequest
callback Callback<LROperation<protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options, callback)

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

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

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

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | 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.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | 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.TestIamPermissionsResponse]>

{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.

undeleteService(request, options)

undeleteService(request?: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Revives a previously deleted managed service. The method restores the service using the configuration at the time the service was deleted. The target service must exist and must have been deleted within the last 30 days.

Operation<response: UndeleteServiceResponse>

Parameters
NameDescription
request IUndeleteServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, protos.google.api.servicemanagement.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. The name of the service. See the
   *  overview (https://cloud.google.com/service-management/overview) for naming
   *  requirements. For example: `example.googleapis.com`.
   */
  // const serviceName = 'abc123'

  // Imports the Servicemanagement library
  const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

  // Instantiates a client
  const servicemanagementClient = new ServiceManagerClient();

  async function callUndeleteService() {
    // Construct request
    const request = {
      serviceName,
    };

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

  callUndeleteService();

undeleteService(request, options, callback)

undeleteService(request: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUndeleteServiceRequest
options CallOptions
callback Callback<LROperation<protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

undeleteService(request, callback)

undeleteService(request: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, callback: Callback<LROperation<protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUndeleteServiceRequest
callback Callback<LROperation<protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, protos.google.api.servicemanagement.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void