TypeScript typings for Access Context Manager API v1
An API for setting attribute based access control to requests to Google Cloud services. Warning: Do not mix v1alpha and v1 API usage in the same access policy. The v1alpha API supports new Access Context Manager features, which may have different attributes or behaviors that are not supported by v1. The practice of mixed API usage within a policy may result in the inability to update that policy, including any access levels or service perimeters belonging to it. It is not recommended to use both v1 and v1alpha for modifying policies with critical service perimeters. Modifications using v1alpha should be limited to policies with non-production/non-critical service perimeters.
For detailed description please check documentation.
Installing
Install typings for Access Context Manager API:
npm install @types/gapi.client.accesscontextmanager-v1 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load('client', () => {
});
Then load api client wrapper:
gapi.client.load(
'https://accesscontextmanager.googleapis.com/$discovery/rest?version=v1',
() => {
},
);
gapi.client.load('accesscontextmanager', 'v1', () => {
});
Don't forget to authenticate your client before sending any request to resources:
var client_id = '',
scope = [
'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) {
} else {
}
},
);
After that you can use Access Context Manager API resources:
await gapi.client.accesscontextmanager.accessPolicies.create({});
await gapi.client.accesscontextmanager.accessPolicies.delete({name: 'name'});
await gapi.client.accesscontextmanager.accessPolicies.get({name: 'name'});
await gapi.client.accesscontextmanager.accessPolicies.getIamPolicy({
resource: 'resource',
});
await gapi.client.accesscontextmanager.accessPolicies.list({});
await gapi.client.accesscontextmanager.accessPolicies.patch({name: 'name'});
await gapi.client.accesscontextmanager.accessPolicies.setIamPolicy({
resource: 'resource',
});
await gapi.client.accesscontextmanager.accessPolicies.testIamPermissions({
resource: 'resource',
});
await gapi.client.accesscontextmanager.operations.cancel({name: 'name'});
await gapi.client.accesscontextmanager.operations.delete({name: 'name'});
await gapi.client.accesscontextmanager.operations.get({name: 'name'});
await gapi.client.accesscontextmanager.operations.list({name: 'name'});
await gapi.client.accesscontextmanager.services.get({name: 'name'});
await gapi.client.accesscontextmanager.services.list({});
For provenance information see Provenance section on NPM