0.0.20241025 • Published 8 months ago

@maxim_mazurok/gapi.client.cloudasset-v1beta1 v0.0.20241025

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

TypeScript typings for Cloud Asset API v1beta1

The Cloud Asset API manages the history and inventory of Google Cloud resources. For detailed description please check documentation.

Installing

Install typings for Cloud Asset API:

npm install @types/gapi.client.cloudasset-v1beta1 --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://cloudasset.googleapis.com/$discovery/rest?version=v1beta1',
  () => {
    // now we can use:
    // gapi.client.cloudasset
  }
);
// 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('cloudasset', 'v1beta1', () => {
  // now we can use:
  // gapi.client.cloudasset
});

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',
  ],
  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 Cloud Asset API resources:

/*
Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.
*/
await gapi.client.cloudasset.folders.exportAssets({parent: 'parent'});

/*
Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.
*/
await gapi.client.cloudasset.organizations.batchGetAssetsHistory({
  parent: 'parent',
});

/*
Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.
*/
await gapi.client.cloudasset.organizations.exportAssets({parent: 'parent'});

/*
Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.
*/
await gapi.client.cloudasset.projects.batchGetAssetsHistory({parent: 'parent'});

/*
Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.
*/
await gapi.client.cloudasset.projects.exportAssets({parent: 'parent'});
0.0.20241025

8 months ago

0.0.20241018

9 months ago

0.0.20241011

9 months ago

0.0.20240927

10 months ago

0.0.20241004

9 months ago

0.0.20240913

10 months ago

0.0.20240923

10 months ago

0.0.20240906

10 months ago

0.0.20240831

10 months ago

0.0.20240823

11 months ago

0.0.20240530

1 year ago

0.0.20240809

11 months ago

0.0.20240806

11 months ago

0.0.20240608

1 year ago

0.0.20240525

1 year ago

0.0.20240803

11 months ago

0.0.20240726

12 months ago

0.0.20240601

1 year ago

0.0.20240816

11 months ago

0.0.20240614

1 year ago

0.0.20240705

12 months ago

0.0.20240629

1 year ago

0.0.20240621

1 year ago

0.0.20240717

12 months ago

0.0.20240719

12 months ago

0.0.20240516

1 year ago

0.0.20240511

1 year ago

0.0.20240504

1 year ago

0.0.20240427

1 year ago

0.0.20240419

1 year ago

0.0.20240412

1 year ago

0.0.20240322

1 year ago

0.0.20240316

1 year ago

0.0.20240302

1 year ago

0.0.20240223

1 year ago

0.0.20240217

1 year ago

0.0.20240209

1 year ago

0.0.20240201

1 year ago

0.0.20240130

1 year ago

0.0.20240126

1 year ago

0.0.20240119

1 year ago

0.0.20240112

1 year ago

0.0.20240105

2 years ago

0.0.20231220

2 years ago

0.0.20231214

2 years ago

0.0.20231208

2 years ago

0.0.20231201

2 years ago

0.0.20230811

2 years ago

0.0.20231111

2 years ago

0.0.20230929

2 years ago

0.0.20230805

2 years ago

0.0.20230729

2 years ago

0.0.20230720

2 years ago

0.0.20230922

2 years ago

0.0.20231020

2 years ago

0.0.20231103

2 years ago

0.0.20230916

2 years ago

0.0.20231006

2 years ago

0.0.20230714

2 years ago

0.0.20231013

2 years ago

0.0.20230707

2 years ago

0.0.20230908

2 years ago

0.0.20230902

2 years ago

0.0.20230630

2 years ago

0.0.20230626

2 years ago

0.0.20230513

2 years ago

0.0.20230520

2 years ago

0.0.20230609

2 years ago

0.0.20230602

2 years ago

0.0.20230429

2 years ago

0.0.20230527

2 years ago

0.0.20230505

2 years ago

0.0.20230414

2 years ago

0.0.20230318

2 years ago

0.0.20230421

2 years ago

0.0.20230304

2 years ago

0.0.20230401

2 years ago

0.0.20230225

2 years ago

0.0.20230325

2 years ago

0.0.20230311

2 years ago

0.0.20230128

2 years ago

0.0.20230204

2 years ago

0.0.20230211

2 years ago

0.0.20221114

3 years ago

0.0.20221201

3 years ago

0.0.20221221

3 years ago

0.0.20221210

3 years ago

0.0.20230121

2 years ago

0.0.20230114

2 years ago

0.0.20221117

3 years ago

0.0.20221028

3 years ago

0.0.20221015

3 years ago

0.0.20221001

3 years ago

0.0.20221021

3 years ago

0.0.20220923

3 years ago

0.0.20220820

3 years ago

0.0.20220910

3 years ago

0.0.20220902

3 years ago

0.0.20220826

3 years ago

0.0.20220812

3 years ago

0.0.20220805

3 years ago