API for working with the system policy. v1beta1
Package
@google-cloud/binary-authorizationConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of SystemPolicyV1Beta1Client.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
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;
};pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};port
static get port(): number;The port for this API service.
scopes
static get scopes(): string[];The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;The DNS address for this API service.
systemPolicyV1Beta1Stub
systemPolicyV1Beta1Stub?: Promise<{
[name: string]: Function;
}>;universeDomain
get universeDomain(): string;warn
warn: (code: string, message: string, warnType?: string) => void;Methods
attestorPath(project, attestor)
attestorPath(project: string, attestor: string): string;Return a fully-qualified attestor resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
attestor |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
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 | |
|---|---|
| Type | Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed. |
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 | |
|---|---|
| Name | Description |
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 | |
|---|---|
| Type | Description |
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. |
getProjectId()
getProjectId(): Promise<string>;| Returns | |
|---|---|
| Type | Description |
Promise<string> |
|
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;| Parameter | |
|---|---|
| Name | Description |
callback |
Callback<string, undefined, undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getSystemPolicy(request, options)
getSystemPolicy(request?: protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest, options?: CallOptions): Promise<[
protos.google.cloud.binaryauthorization.v1beta1.IPolicy,
(protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest | undefined),
{} | undefined
]>;Gets the current system policy in the specified location.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetSystemPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.binaryauthorization.v1beta1.IPolicy,
(protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest | 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. |
/**
* 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 resource name, in the format `locations/* /policy`.
* Note that the system policy is not associated with a project.
*/
// const name = 'abc123'
// Imports the Binaryauthorization library
const {SystemPolicyV1Beta1Client} = require('@google-cloud/binary-authorization').v1beta1;
// Instantiates a client
const binaryauthorizationClient = new SystemPolicyV1Beta1Client();
async function callGetSystemPolicy() {
// Construct request
const request = {
name,
};
// Run request
const response = await binaryauthorizationClient.getSystemPolicy(request);
console.log(response);
}
callGetSystemPolicy();
getSystemPolicy(request, options, callback)
getSystemPolicy(request: protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.binaryauthorization.v1beta1.IPolicy, protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetSystemPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.binaryauthorization.v1beta1.IPolicy, protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getSystemPolicy(request, callback)
getSystemPolicy(request: protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest, callback: Callback<protos.google.cloud.binaryauthorization.v1beta1.IPolicy, protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetSystemPolicyRequest
|
callback |
Callback<protos.google.cloud.binaryauthorization.v1beta1.IPolicy, protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
locationPolicyPath(location)
locationPolicyPath(location: string): string;Return a fully-qualified locationPolicy resource name string.
| Parameter | |
|---|---|
| Name | Description |
location |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
matchAttestorFromAttestorName(attestorName)
matchAttestorFromAttestorName(attestorName: string): string | number;Parse the attestor from Attestor resource.
| Parameter | |
|---|---|
| Name | Description |
attestorName |
string
A fully-qualified path representing Attestor resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the attestor. |
matchLocationFromLocationPolicyName(locationPolicyName)
matchLocationFromLocationPolicyName(locationPolicyName: string): string | number;Parse the location from LocationPolicy resource.
| Parameter | |
|---|---|
| Name | Description |
locationPolicyName |
string
A fully-qualified path representing location_policy resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromAttestorName(attestorName)
matchProjectFromAttestorName(attestorName: string): string | number;Parse the project from Attestor resource.
| Parameter | |
|---|---|
| Name | Description |
attestorName |
string
A fully-qualified path representing Attestor resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;Parse the project from Project resource.
| Parameter | |
|---|---|
| Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectPolicyName(projectPolicyName)
matchProjectFromProjectPolicyName(projectPolicyName: string): string | number;Parse the project from ProjectPolicy resource.
| Parameter | |
|---|---|
| Name | Description |
projectPolicyName |
string
A fully-qualified path representing project_policy resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
projectPath(project)
projectPath(project: string): string;Return a fully-qualified project resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectPolicyPath(project)
projectPolicyPath(project: string): string;Return a fully-qualified projectPolicy resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
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 | |
|---|---|
| Name | Description |
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 | |
|---|---|
| Type | Description |
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. |
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 | |
|---|---|
| Name | Description |
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 | |
|---|---|
| Type | Description |
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. |