Binary Authorization V1beta1 API - Class Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client (v0.9.0)

Reference documentation and code samples for the Binary Authorization V1beta1 API class Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.

REST client for the BinauthzManagementService service.

Google Cloud Management Service for Binary Authorization admission policies and attestation authorities.

This API implements a REST model with the following objects:

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the BinauthzManagementService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all BinauthzManagementService clients
::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the BinauthzManagementService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_attestor

def create_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def create_attestor(parent: nil, attestor_id: nil, attestor: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor

Creates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the attestor already exists.

Overloads
def create_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
Pass arguments to create_attestor via a request object, either of type CreateAttestorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_attestor(parent: nil, attestor_id: nil, attestor: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
Pass arguments to create_attestor via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_attestor

def delete_attestor(request, options = nil) -> ::Google::Protobuf::Empty
def delete_attestor(name: nil) -> ::Google::Protobuf::Empty

Deletes an attestor. Returns NOT_FOUND if the attestor does not exist.

Overloads
def delete_attestor(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_attestor via a request object, either of type DeleteAttestorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_attestor(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_attestor via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the attestors to delete, in the format projects/*/attestors/*.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_attestor

def get_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def get_attestor(name: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor

Gets an attestor. Returns NOT_FOUND if the attestor does not exist.

Overloads
def get_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
Pass arguments to get_attestor via a request object, either of type GetAttestorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_attestor(name: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
Pass arguments to get_attestor via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the attestor to retrieve, in the format projects/*/attestors/*.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_policy

def get_policy(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
def get_policy(name: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy

A policy specifies the attestors that must attest to a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy.

Gets the policy for this project. Returns a default policy if the project does not have one.

Overloads
def get_policy(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
Pass arguments to get_policy via a request object, either of type GetPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_policy(name: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
Pass arguments to get_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the policy to retrieve, in the format projects/*/policy.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

def initialize() { |config| ... } -> Client

Create a new BinauthzManagementService REST client object.

Yields
  • (config) — Configure the BinauthzManagementService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_attestors

def list_attestors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>
def list_attestors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>

Lists attestors. Returns INVALID_ARGUMENT if the project does not exist.

Overloads
def list_attestors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>
Pass arguments to list_attestors via a request object, either of type ListAttestorsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_attestors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>
Pass arguments to list_attestors via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the project associated with the attestors, in the format projects/*.
  • page_size (::Integer) — Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return. Typically, this is the value of ListAttestorsResponse.next_page_token returned from the previous call to the ListAttestors method.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_attestor

def update_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def update_attestor(attestor: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor

Updates an attestor. Returns NOT_FOUND if the attestor does not exist.

Overloads
def update_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
Pass arguments to update_attestor via a request object, either of type UpdateAttestorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_attestor(attestor: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
Pass arguments to update_attestor via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_policy

def update_policy(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
def update_policy(policy: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy

Creates or updates a project's policy, and returns a copy of the new policy. A policy is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed.

Overloads
def update_policy(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
Pass arguments to update_policy via a request object, either of type UpdatePolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_policy(policy: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
Pass arguments to update_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.