0.0.20240504 • Published 2 days ago

@maxim_mazurok/gapi.client.servicecontrol-v2 v0.0.20240504

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

TypeScript typings for Service Control API v2

Provides admission control and telemetry reporting for services integrated with Service Infrastructure. For detailed description please check documentation.

Installing

Install typings for Service Control API:

npm install @types/gapi.client.servicecontrol-v2 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://servicecontrol.googleapis.com/$discovery/rest?version=v2',
  () => {
    // now we can use:
    // gapi.client.servicecontrol
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('servicecontrol', 'v2', () => {
  // now we can use:
  // gapi.client.servicecontrol
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',

    // Manage your Google Service Control data
    'https://www.googleapis.com/auth/servicecontrol',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Service Control API resources:

/*
Private Preview. This feature is only available for approved services. This method provides admission control for services that are integrated with [Service Infrastructure](https://cloud.google.com/service-infrastructure). It checks whether an operation should be allowed based on the service configuration and relevant policies. It must be called before the operation is executed. For more information, see [Admission Control](https://cloud.google.com/service-infrastructure/docs/admission-control). NOTE: The admission control has an expected policy propagation delay of 60s. The caller **must** not depend on the most recent policy changes. NOTE: The admission control has a hard limit of 1 referenced resources per call. If an operation refers to more than 1 resources, the caller must call the Check method multiple times. This method requires the `servicemanagement.services.check` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).
*/
await gapi.client.servicecontrol.services.check({serviceName: 'serviceName'});

/*
Private Preview. This feature is only available for approved services. This method provides telemetry reporting for services that are integrated with [Service Infrastructure](https://cloud.google.com/service-infrastructure). It reports a list of operations that have occurred on a service. It must be called after the operations have been executed. For more information, see [Telemetry Reporting](https://cloud.google.com/service-infrastructure/docs/telemetry-reporting). NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB per Report call. It is recommended to have no more than 100 operations per call. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).
*/
await gapi.client.servicecontrol.services.report({serviceName: 'serviceName'});
0.0.20240504

2 days ago

0.0.20240426

10 days ago

0.0.20240419

15 days ago

0.0.20240412

24 days ago

0.0.20240322

1 month ago

0.0.20240315

2 months ago

0.0.20240309

2 months ago

0.0.20240301

2 months ago

0.0.20240223

2 months ago

0.0.20240216

3 months ago

0.0.20240211

3 months ago

0.0.20240203

3 months ago

0.0.20240130

3 months ago

0.0.20240126

3 months ago

0.0.20240119

4 months ago

0.0.20240112

4 months ago

0.0.20240109

4 months ago

0.0.20240101

4 months ago

0.0.20231211

5 months ago

0.0.20231201

5 months ago

0.0.20231128

5 months ago

0.0.20230812

9 months ago

0.0.20231110

6 months ago

0.0.20231030

6 months ago

0.0.20230929

7 months ago

0.0.20230805

9 months ago

0.0.20230728

10 months ago

0.0.20230720

10 months ago

0.0.20231019

7 months ago

0.0.20230923

8 months ago

0.0.20231104

6 months ago

0.0.20230915

8 months ago

0.0.20230717

10 months ago

0.0.20231006

7 months ago

0.0.20230831

8 months ago

0.0.20231016

7 months ago

0.0.20230707

10 months ago

0.0.20230908

8 months ago

0.0.20230630

10 months ago

0.0.20230623

11 months ago

0.0.20230519

12 months ago

0.0.20230619

11 months ago

0.0.20230515

12 months ago

0.0.20230609

11 months ago

0.0.20230601

11 months ago

0.0.20230529

11 months ago

0.0.20230504

1 year ago

0.0.20230428

1 year ago

0.0.20230414

1 year ago

0.0.20230317

1 year ago

0.0.20230421

1 year ago

0.0.20230224

1 year ago

0.0.20230324

1 year ago

0.0.20230407

1 year ago

0.0.20230306

1 year ago

0.0.20230331

1 year ago

0.0.20230310

1 year ago

0.0.20230215

1 year ago

0.0.20230221

1 year ago

0.0.20230203

1 year ago

0.0.20230127

1 year ago

0.0.20230130

1 year ago

0.0.20230210

1 year ago

0.0.20221204

1 year ago

0.0.20221104

1 year ago

0.0.20230104

1 year ago

0.0.20221111

1 year ago

0.0.20230109

1 year ago

0.0.20230124

1 year ago

0.0.20221020

2 years ago

0.0.20221028

2 years ago

0.0.20221014

2 years ago

0.0.20220923

2 years ago

0.0.20220829

2 years ago

0.0.20220819

2 years ago

0.0.20220909

2 years ago

0.0.20220902

2 years ago

0.0.20220915

2 years ago

0.0.20220812

2 years ago

0.0.20220805

2 years ago

0.0.20220729

2 years ago