Class ContainerAnalysisClient (2.3.0)

public abstract class ContainerAnalysisClient

ContainerAnalysis client wrapper, for convenient use.

Inheritance

Object > ContainerAnalysisClient

Namespace

Google.Cloud.DevTools.ContainerAnalysis.V1

Assembly

Google.Cloud.DevTools.ContainerAnalysis.V1.dll

Remarks

Retrieves analysis results of Cloud components such as Docker container images. The Container Analysis API is an implementation of the Grafeas API.

Analysis results are stored as a series of occurrences. An Occurrence contains information about a specific analysis instance on a resource. An occurrence refers to a Note. A note contains details describing the analysis and is generally stored in a separate project, called a Provider. Multiple occurrences can refer to the same note.

For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ContainerAnalysis service, which is a host of "containeranalysis.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ContainerAnalysis scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default ContainerAnalysis scopes are:

GrafeasClient

public virtual GrafeasClient GrafeasClient { get; }

Returns a GrafeasClient using the same endpoint and credentials as this client.

Property Value
TypeDescription
GrafeasClient

GrpcClient

public virtual ContainerAnalysis.ContainerAnalysisClient GrpcClient { get; }

The underlying gRPC ContainerAnalysis client

Property Value
TypeDescription
ContainerAnalysis.ContainerAnalysisClient

Methods

Create()

public static ContainerAnalysisClient Create()

Synchronously creates a ContainerAnalysisClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ContainerAnalysisClientBuilder.

Returns
TypeDescription
ContainerAnalysisClient

The created ContainerAnalysisClient.

CreateAsync(CancellationToken)

public static Task<ContainerAnalysisClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a ContainerAnalysisClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ContainerAnalysisClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ContainerAnalysisClient>

The task representing the created ContainerAnalysisClient.

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = containerAnalysisClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = containerAnalysisClient.GetIamPolicy(request);

GetIamPolicy(String, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = containerAnalysisClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await containerAnalysisClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await containerAnalysisClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await containerAnalysisClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await containerAnalysisClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(String, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await containerAnalysisClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(String, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

Gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await containerAnalysisClient.GetIamPolicyAsync(resource);

GetVulnerabilityOccurrencesSummary(ProjectName, String, CallSettings)

public virtual VulnerabilityOccurrencesSummary GetVulnerabilityOccurrencesSummary(ProjectName parent, string filter, CallSettings callSettings = null)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
parentProjectName

The name of the project to get a vulnerability summary for in the form of projects/[PROJECT_ID].

filterString

The filter expression.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
VulnerabilityOccurrencesSummary

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string filter = "";
// Make the request
VulnerabilityOccurrencesSummary response = containerAnalysisClient.GetVulnerabilityOccurrencesSummary(parent, filter);

GetVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest, CallSettings)

public virtual VulnerabilityOccurrencesSummary GetVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest request, CallSettings callSettings = null)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
requestGetVulnerabilityOccurrencesSummaryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
VulnerabilityOccurrencesSummary

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
GetVulnerabilityOccurrencesSummaryRequest request = new GetVulnerabilityOccurrencesSummaryRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
VulnerabilityOccurrencesSummary response = containerAnalysisClient.GetVulnerabilityOccurrencesSummary(request);

GetVulnerabilityOccurrencesSummary(String, String, CallSettings)

public virtual VulnerabilityOccurrencesSummary GetVulnerabilityOccurrencesSummary(string parent, string filter, CallSettings callSettings = null)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
parentString

The name of the project to get a vulnerability summary for in the form of projects/[PROJECT_ID].

filterString

The filter expression.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
VulnerabilityOccurrencesSummary

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string filter = "";
// Make the request
VulnerabilityOccurrencesSummary response = containerAnalysisClient.GetVulnerabilityOccurrencesSummary(parent, filter);

GetVulnerabilityOccurrencesSummaryAsync(ProjectName, String, CallSettings)

public virtual Task<VulnerabilityOccurrencesSummary> GetVulnerabilityOccurrencesSummaryAsync(ProjectName parent, string filter, CallSettings callSettings = null)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
parentProjectName

The name of the project to get a vulnerability summary for in the form of projects/[PROJECT_ID].

filterString

The filter expression.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<VulnerabilityOccurrencesSummary>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string filter = "";
// Make the request
VulnerabilityOccurrencesSummary response = await containerAnalysisClient.GetVulnerabilityOccurrencesSummaryAsync(parent, filter);

GetVulnerabilityOccurrencesSummaryAsync(ProjectName, String, CancellationToken)

public virtual Task<VulnerabilityOccurrencesSummary> GetVulnerabilityOccurrencesSummaryAsync(ProjectName parent, string filter, CancellationToken cancellationToken)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
parentProjectName

The name of the project to get a vulnerability summary for in the form of projects/[PROJECT_ID].

filterString

The filter expression.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<VulnerabilityOccurrencesSummary>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string filter = "";
// Make the request
VulnerabilityOccurrencesSummary response = await containerAnalysisClient.GetVulnerabilityOccurrencesSummaryAsync(parent, filter);

GetVulnerabilityOccurrencesSummaryAsync(GetVulnerabilityOccurrencesSummaryRequest, CallSettings)

public virtual Task<VulnerabilityOccurrencesSummary> GetVulnerabilityOccurrencesSummaryAsync(GetVulnerabilityOccurrencesSummaryRequest request, CallSettings callSettings = null)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
requestGetVulnerabilityOccurrencesSummaryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<VulnerabilityOccurrencesSummary>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
GetVulnerabilityOccurrencesSummaryRequest request = new GetVulnerabilityOccurrencesSummaryRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
VulnerabilityOccurrencesSummary response = await containerAnalysisClient.GetVulnerabilityOccurrencesSummaryAsync(request);

GetVulnerabilityOccurrencesSummaryAsync(GetVulnerabilityOccurrencesSummaryRequest, CancellationToken)

public virtual Task<VulnerabilityOccurrencesSummary> GetVulnerabilityOccurrencesSummaryAsync(GetVulnerabilityOccurrencesSummaryRequest request, CancellationToken cancellationToken)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
requestGetVulnerabilityOccurrencesSummaryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<VulnerabilityOccurrencesSummary>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
GetVulnerabilityOccurrencesSummaryRequest request = new GetVulnerabilityOccurrencesSummaryRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
VulnerabilityOccurrencesSummary response = await containerAnalysisClient.GetVulnerabilityOccurrencesSummaryAsync(request);

GetVulnerabilityOccurrencesSummaryAsync(String, String, CallSettings)

public virtual Task<VulnerabilityOccurrencesSummary> GetVulnerabilityOccurrencesSummaryAsync(string parent, string filter, CallSettings callSettings = null)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
parentString

The name of the project to get a vulnerability summary for in the form of projects/[PROJECT_ID].

filterString

The filter expression.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<VulnerabilityOccurrencesSummary>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string filter = "";
// Make the request
VulnerabilityOccurrencesSummary response = await containerAnalysisClient.GetVulnerabilityOccurrencesSummaryAsync(parent, filter);

GetVulnerabilityOccurrencesSummaryAsync(String, String, CancellationToken)

public virtual Task<VulnerabilityOccurrencesSummary> GetVulnerabilityOccurrencesSummaryAsync(string parent, string filter, CancellationToken cancellationToken)

Gets a summary of the number and severity of occurrences.

Parameters
NameDescription
parentString

The name of the project to get a vulnerability summary for in the form of projects/[PROJECT_ID].

filterString

The filter expression.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<VulnerabilityOccurrencesSummary>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string filter = "";
// Make the request
VulnerabilityOccurrencesSummary response = await containerAnalysisClient.GetVulnerabilityOccurrencesSummaryAsync(parent, filter);

SetIamPolicy(IResourceName, Policy, CallSettings)

public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = containerAnalysisClient.SetIamPolicy(resource, policy);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = containerAnalysisClient.SetIamPolicy(request);

SetIamPolicy(String, Policy, CallSettings)

public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = containerAnalysisClient.SetIamPolicy(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await containerAnalysisClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await containerAnalysisClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await containerAnalysisClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await containerAnalysisClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(String, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await containerAnalysisClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(String, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)

Sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await containerAnalysisClient.SetIamPolicyAsync(resource, policy);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TestIamPermissions(IResourceName, IEnumerable<String>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = containerAnalysisClient.TestIamPermissions(resource, permissions);

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = containerAnalysisClient.TestIamPermissions(request);

TestIamPermissions(String, IEnumerable<String>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = containerAnalysisClient.TestIamPermissions(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await containerAnalysisClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await containerAnalysisClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await containerAnalysisClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await containerAnalysisClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(String, IEnumerable<String>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await containerAnalysisClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(String, IEnumerable<String>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await containerAnalysisClient.TestIamPermissionsAsync(resource, permissions);