Class OsConfigZonalServiceClient (2.53.0)

GitHub RepositoryProduct Reference

Service Description: 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.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (OsConfigZonalServiceClient osConfigZonalServiceClient =
     OsConfigZonalServiceClient.create()) {
   OSPolicyAssignmentName name =
       OSPolicyAssignmentName.of("[PROJECT]", "[LOCATION]", "[OS_POLICY_ASSIGNMENT]");
   OSPolicyAssignment response = osConfigZonalServiceClient.getOSPolicyAssignment(name);
 }
 

Note: close() needs to be called on the OsConfigZonalServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

CreateOSPolicyAssignment

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createOSPolicyAssignmentAsync(CreateOSPolicyAssignmentRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createOSPolicyAssignmentAsync(LocationName parent, OSPolicyAssignment osPolicyAssignment, String osPolicyAssignmentId)

  • createOSPolicyAssignmentAsync(String parent, OSPolicyAssignment osPolicyAssignment, String osPolicyAssignmentId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createOSPolicyAssignmentOperationCallable()

  • createOSPolicyAssignmentCallable()

UpdateOSPolicyAssignment

Update an existing 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.

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateOSPolicyAssignmentAsync(UpdateOSPolicyAssignmentRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateOSPolicyAssignmentAsync(OSPolicyAssignment osPolicyAssignment, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateOSPolicyAssignmentOperationCallable()

  • updateOSPolicyAssignmentCallable()

GetOSPolicyAssignment

Retrieve an existing OS policy assignment.

This method always returns the latest revision. In order to retrieve a previous revision of the assignment, also provide the revision ID in the name parameter.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getOSPolicyAssignment(GetOSPolicyAssignmentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getOSPolicyAssignment(OSPolicyAssignmentName name)

  • getOSPolicyAssignment(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getOSPolicyAssignmentCallable()

ListOSPolicyAssignments

List the OS policy assignments under the parent resource.

For each OS policy assignment, the latest revision is returned.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listOSPolicyAssignments(ListOSPolicyAssignmentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listOSPolicyAssignments(LocationName parent)

  • listOSPolicyAssignments(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listOSPolicyAssignmentsPagedCallable()

  • listOSPolicyAssignmentsCallable()

ListOSPolicyAssignmentRevisions

List the OS policy assignment revisions for a given OS policy assignment.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listOSPolicyAssignmentRevisions(OSPolicyAssignmentName name)

  • listOSPolicyAssignmentRevisions(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listOSPolicyAssignmentRevisionsPagedCallable()

  • listOSPolicyAssignmentRevisionsCallable()

DeleteOSPolicyAssignment

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 informa