Google Cloud OS Config v1 API - Class OsConfigZonalServiceClient (2.1.0)

public abstract class OsConfigZonalServiceClient

Reference documentation and code samples for the Google Cloud OS Config v1 API class OsConfigZonalServiceClient.

OsConfigZonalService client wrapper, for convenient use.

Inheritance

Object > OsConfigZonalServiceClient

Namespace

Google.Cloud.OsConfig.V1

Assembly

Google.Cloud.OsConfig.V1.dll

Remarks

Zonal OS Config API

The OS Config service is the server-side component that allows users to manage package installations and patch jobs for Compute Engine VM instances.

Properties

CreateOSPolicyAssignmentOperationsClient

public virtual OperationsClient CreateOSPolicyAssignmentOperationsClient { get; }

The long-running operations client for CreateOSPolicyAssignment.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default OsConfigZonalService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default OsConfigZonalService scopes are:

DeleteOSPolicyAssignmentOperationsClient

public virtual OperationsClient DeleteOSPolicyAssignmentOperationsClient { get; }

The long-running operations client for DeleteOSPolicyAssignment.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual OsConfigZonalService.OsConfigZonalServiceClient GrpcClient { get; }

The underlying gRPC OsConfigZonalService client

Property Value
TypeDescription
OsConfigZonalService.OsConfigZonalServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UpdateOSPolicyAssignmentOperationsClient

public virtual OperationsClient UpdateOSPolicyAssignmentOperationsClient { get; }

The long-running operations client for UpdateOSPolicyAssignment.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static OsConfigZonalServiceClient Create()

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

Returns
TypeDescription
OsConfigZonalServiceClient

The created OsConfigZonalServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<OsConfigZonalServiceClient>

The task representing the created OsConfigZonalServiceClient.

CreateOSPolicyAssignment(LocationName, OSPolicyAssignment, String, CallSettings)

public virtual Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> CreateOSPolicyAssignment(LocationName parent, OSPolicyAssignment osPolicyAssignment, string osPolicyAssignmentId, CallSettings callSettings = null)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
parentLocationName

Required. The parent resource name in the form: projects/{project}/locations/{location}

osPolicyAssignmentOSPolicyAssignment

Required. The OS policy assignment to be created.

osPolicyAssignmentIdString

Required. The logical name of the OS policy assignment in the project with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the project.
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
OSPolicyAssignment osPolicyAssignment = new OSPolicyAssignment();
string osPolicyAssignmentId = "";
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = osConfigZonalServiceClient.CreateOSPolicyAssignment(parent, osPolicyAssignment, osPolicyAssignmentId);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest, CallSettings)

public virtual Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest request, CallSettings callSettings = null)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
requestCreateOSPolicyAssignmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
CreateOSPolicyAssignmentRequest request = new CreateOSPolicyAssignmentRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    OsPolicyAssignment = new OSPolicyAssignment(),
    OsPolicyAssignmentId = "",
};
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = osConfigZonalServiceClient.CreateOSPolicyAssignment(request);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignment(String, OSPolicyAssignment, String, CallSettings)

public virtual Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> CreateOSPolicyAssignment(string parent, OSPolicyAssignment osPolicyAssignment, string osPolicyAssignmentId, CallSettings callSettings = null)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
parentString

Required. The parent resource name in the form: projects/{project}/locations/{location}

osPolicyAssignmentOSPolicyAssignment

Required. The OS policy assignment to be created.

osPolicyAssignmentIdString

Required. The logical name of the OS policy assignment in the project with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the project.
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
OSPolicyAssignment osPolicyAssignment = new OSPolicyAssignment();
string osPolicyAssignmentId = "";
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = osConfigZonalServiceClient.CreateOSPolicyAssignment(parent, osPolicyAssignment, osPolicyAssignmentId);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignmentAsync(LocationName, OSPolicyAssignment, String, CallSettings)

public virtual Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>> CreateOSPolicyAssignmentAsync(LocationName parent, OSPolicyAssignment osPolicyAssignment, string osPolicyAssignmentId, CallSettings callSettings = null)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
parentLocationName

Required. The parent resource name in the form: projects/{project}/locations/{location}

osPolicyAssignmentOSPolicyAssignment

Required. The OS policy assignment to be created.

osPolicyAssignmentIdString

Required. The logical name of the OS policy assignment in the project with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the project.
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
OSPolicyAssignment osPolicyAssignment = new OSPolicyAssignment();
string osPolicyAssignmentId = "";
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.CreateOSPolicyAssignmentAsync(parent, osPolicyAssignment, osPolicyAssignmentId);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignmentAsync(LocationName, OSPolicyAssignment, String, CancellationToken)

public virtual Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>> CreateOSPolicyAssignmentAsync(LocationName parent, OSPolicyAssignment osPolicyAssignment, string osPolicyAssignmentId, CancellationToken cancellationToken)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
parentLocationName

Required. The parent resource name in the form: projects/{project}/locations/{location}

osPolicyAssignmentOSPolicyAssignment

Required. The OS policy assignment to be created.

osPolicyAssignmentIdString

Required. The logical name of the OS policy assignment in the project with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the project.
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
OSPolicyAssignment osPolicyAssignment = new OSPolicyAssignment();
string osPolicyAssignmentId = "";
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.CreateOSPolicyAssignmentAsync(parent, osPolicyAssignment, osPolicyAssignmentId);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignmentAsync(CreateOSPolicyAssignmentRequest, CallSettings)

public virtual Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>> CreateOSPolicyAssignmentAsync(CreateOSPolicyAssignmentRequest request, CallSettings callSettings = null)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
requestCreateOSPolicyAssignmentRequest

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<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
CreateOSPolicyAssignmentRequest request = new CreateOSPolicyAssignmentRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    OsPolicyAssignment = new OSPolicyAssignment(),
    OsPolicyAssignmentId = "",
};
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.CreateOSPolicyAssignmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignmentAsync(CreateOSPolicyAssignmentRequest, CancellationToken)

public virtual Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>> CreateOSPolicyAssignmentAsync(CreateOSPolicyAssignmentRequest request, CancellationToken cancellationToken)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
requestCreateOSPolicyAssignmentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
CreateOSPolicyAssignmentRequest request = new CreateOSPolicyAssignmentRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    OsPolicyAssignment = new OSPolicyAssignment(),
    OsPolicyAssignmentId = "",
};
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.CreateOSPolicyAssignmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignmentAsync(String, OSPolicyAssignment, String, CallSettings)

public virtual Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>> CreateOSPolicyAssignmentAsync(string parent, OSPolicyAssignment osPolicyAssignment, string osPolicyAssignmentId, CallSettings callSettings = null)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
parentString

Required. The parent resource name in the form: projects/{project}/locations/{location}

osPolicyAssignmentOSPolicyAssignment

Required. The OS policy assignment to be created.

osPolicyAssignmentIdString

Required. The logical name of the OS policy assignment in the project with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the project.
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
OSPolicyAssignment osPolicyAssignment = new OSPolicyAssignment();
string osPolicyAssignmentId = "";
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.CreateOSPolicyAssignmentAsync(parent, osPolicyAssignment, osPolicyAssignmentId);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

CreateOSPolicyAssignmentAsync(String, OSPolicyAssignment, String, CancellationToken)

public virtual Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>> CreateOSPolicyAssignmentAsync(string parent, OSPolicyAssignment osPolicyAssignment, string osPolicyAssignmentId, CancellationToken cancellationToken)

Create an OS policy assignment.

This method also creates the first revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
parentString

Required. The parent resource name in the form: projects/{project}/locations/{location}

osPolicyAssignmentOSPolicyAssignment

Required. The OS policy assignment to be created.

osPolicyAssignmentIdString

Required. The logical name of the OS policy assignment in the project with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the project.
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
OSPolicyAssignment osPolicyAssignment = new OSPolicyAssignment();
string osPolicyAssignmentId = "";
// Make the request
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.CreateOSPolicyAssignmentAsync(parent, osPolicyAssignment, osPolicyAssignmentId);

// Poll until the returned long-running operation is complete
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OSPolicyAssignment result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OSPolicyAssignment, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceCreateOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    OSPolicyAssignment retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest, CallSettings)

public virtual Operation<Empty, OSPolicyAssignmentOperationMetadata> DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest request, CallSettings callSettings = null)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
requestDeleteOSPolicyAssignmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OSPolicyAssignmentOperationMetadata>

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
DeleteOSPolicyAssignmentRequest request = new DeleteOSPolicyAssignmentRequest
{
    OSPolicyAssignmentName = OSPolicyAssignmentName.FromProjectLocationOsPolicyAssignment("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]"),
};
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = osConfigZonalServiceClient.DeleteOSPolicyAssignment(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignment(OSPolicyAssignmentName, CallSettings)

public virtual Operation<Empty, OSPolicyAssignmentOperationMetadata> DeleteOSPolicyAssignment(OSPolicyAssignmentName name, CallSettings callSettings = null)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
nameOSPolicyAssignmentName

Required. The name of the OS policy assignment to be deleted

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OSPolicyAssignmentOperationMetadata>

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
OSPolicyAssignmentName name = OSPolicyAssignmentName.FromProjectLocationOsPolicyAssignment("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]");
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = osConfigZonalServiceClient.DeleteOSPolicyAssignment(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignment(String, CallSettings)

public virtual Operation<Empty, OSPolicyAssignmentOperationMetadata> DeleteOSPolicyAssignment(string name, CallSettings callSettings = null)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
nameString

Required. The name of the OS policy assignment to be deleted

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OSPolicyAssignmentOperationMetadata>

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/osPolicyAssignments/[OS_POLICY_ASSIGNMENT]";
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = osConfigZonalServiceClient.DeleteOSPolicyAssignment(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignmentAsync(DeleteOSPolicyAssignmentRequest, CallSettings)

public virtual Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>> DeleteOSPolicyAssignmentAsync(DeleteOSPolicyAssignmentRequest request, CallSettings callSettings = null)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
requestDeleteOSPolicyAssignmentRequest

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<Operation<Empty, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteOSPolicyAssignmentRequest request = new DeleteOSPolicyAssignmentRequest
{
    OSPolicyAssignmentName = OSPolicyAssignmentName.FromProjectLocationOsPolicyAssignment("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]"),
};
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.DeleteOSPolicyAssignmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignmentAsync(DeleteOSPolicyAssignmentRequest, CancellationToken)

public virtual Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>> DeleteOSPolicyAssignmentAsync(DeleteOSPolicyAssignmentRequest request, CancellationToken cancellationToken)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
requestDeleteOSPolicyAssignmentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteOSPolicyAssignmentRequest request = new DeleteOSPolicyAssignmentRequest
{
    OSPolicyAssignmentName = OSPolicyAssignmentName.FromProjectLocationOsPolicyAssignment("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]"),
};
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.DeleteOSPolicyAssignmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignmentAsync(OSPolicyAssignmentName, CallSettings)

public virtual Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>> DeleteOSPolicyAssignmentAsync(OSPolicyAssignmentName name, CallSettings callSettings = null)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
nameOSPolicyAssignmentName

Required. The name of the OS policy assignment to be deleted

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
OSPolicyAssignmentName name = OSPolicyAssignmentName.FromProjectLocationOsPolicyAssignment("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]");
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.DeleteOSPolicyAssignmentAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignmentAsync(OSPolicyAssignmentName, CancellationToken)

public virtual Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>> DeleteOSPolicyAssignmentAsync(OSPolicyAssignmentName name, CancellationToken cancellationToken)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
nameOSPolicyAssignmentName

Required. The name of the OS policy assignment to be deleted

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
OSPolicyAssignmentName name = OSPolicyAssignmentName.FromProjectLocationOsPolicyAssignment("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]");
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.DeleteOSPolicyAssignmentAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignmentAsync(String, CallSettings)

public virtual Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>> DeleteOSPolicyAssignmentAsync(string name, CallSettings callSettings = null)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
nameString

Required. The name of the OS policy assignment to be deleted

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/osPolicyAssignments/[OS_POLICY_ASSIGNMENT]";
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.DeleteOSPolicyAssignmentAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteOSPolicyAssignmentAsync(String, CancellationToken)

public virtual Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>> DeleteOSPolicyAssignmentAsync(string name, CancellationToken cancellationToken)

Delete the OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted.

For more information, see Method: projects.locations.osPolicyAssignments.operations.cancel.

Parameters
NameDescription
nameString

Required. The name of the OS policy assignment to be deleted

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OSPolicyAssignmentOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/osPolicyAssignments/[OS_POLICY_ASSIGNMENT]";
// Make the request
Operation<Empty, OSPolicyAssignmentOperationMetadata> response = await osConfigZonalServiceClient.DeleteOSPolicyAssignmentAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OSPolicyAssignmentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OSPolicyAssignmentOperationMetadata> retrievedResponse = await osConfigZonalServiceClient.PollOnceDeleteOSPolicyAssignmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetInventory(GetInventoryRequest, CallSettings)

public virtual Inventory GetInventory(GetInventoryRequest request, CallSettings callSettings = null)

Get inventory data for the specified VM instance. If the VM has no associated inventory, the message NOT_FOUND is returned.

Parameters
NameDescription
requestGetInventoryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Inventory

The RPC response.

Example
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
GetInventoryRequest request = new GetInventoryRequest
{
    InventoryName = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
    View = InventoryView.Unspecified,
};
// Make the request
Inventory response = osConfigZonalServiceClient.GetInventory(request);

GetInventory(InventoryName, CallSettings)

public virtual Inventory GetInventory(InventoryName name, CallSettings callSettings = null)

Get inventory data for the specified VM instance. If the VM has no associated inventory, the message NOT_FOUND is returned.

Parameters
NameDescription
nameInventoryName

Required. API resource name for inventory resource.

Format: projects/{project}/locations/{location}/instances/{instance}/inventory

For {project}, either project-number or project-id can be provided. For {instance}, either Compute Engine instance-id or