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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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.
def create_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
create_attestor
via a request object, either of type
CreateAttestorRequest or an equivalent Hash.
- 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
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).
- parent (::String) — Required. The parent of this attestor.
- attestor_id (::String) — Required. The attestors ID.
-
attestor (::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash) — Required. The initial attestor value. The service will
overwrite the attestor name field with the resource name,
in the format
projects/*/attestors/*
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::BinaryAuthorization::V1beta1::Attestor)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest.new # Call the create_attestor method. result = client.create_attestor request # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. p result
#delete_attestor
def delete_attestor(request, options = nil) -> ::Google::Protobuf::Empty
def delete_attestor(name: nil) -> ::Google::Protobuf::Empty
def delete_attestor(request, options = nil) -> ::Google::Protobuf::Empty
delete_attestor
via a request object, either of type
DeleteAttestorRequest or an equivalent Hash.
- 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
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).
-
name (::String) — Required. The name of the attestors to delete, in the format
projects/*/attestors/*
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest.new # Call the delete_attestor method. result = client.delete_attestor request # The returned object is of type Google::Protobuf::Empty. p result
#get_attestor
def get_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def get_attestor(name: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def get_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
get_attestor
via a request object, either of type
GetAttestorRequest or an equivalent Hash.
- 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
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).
-
name (::String) — Required. The name of the attestor to retrieve, in the format
projects/*/attestors/*
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::BinaryAuthorization::V1beta1::Attestor)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest.new # Call the get_attestor method. result = client.get_attestor request # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. p result
#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.
def get_policy(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
get_policy
via a request object, either of type
GetPolicyRequest or an equivalent Hash.
- 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
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).
-
name (::String) — Required. The resource name of the policy to retrieve,
in the format
projects/*/policy
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::BinaryAuthorization::V1beta1::Policy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest.new # Call the get_policy method. result = client.get_policy request # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new BinauthzManagementService REST client object.
- (config) — Configure the BinauthzManagementService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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.
def list_attestors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>
list_attestors
via a request object, either of type
ListAttestorsRequest or an equivalent Hash.
- 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>
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).
-
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.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest.new # Call the list_attestors method. result = client.list_attestors request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor. p item end
#update_attestor
def update_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def update_attestor(attestor: nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
def update_attestor(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor
update_attestor
via a request object, either of type
UpdateAttestorRequest or an equivalent Hash.
- 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
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).
-
attestor (::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash) — Required. The updated attestor value. The service will
overwrite the attestor name field with the resource name
in the request URL, in the format
projects/*/attestors/*
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::BinaryAuthorization::V1beta1::Attestor)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest.new # Call the update_attestor method. result = client.update_attestor request # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. p result
#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.
def update_policy(request, options = nil) -> ::Google::Cloud::BinaryAuthorization::V1beta1::Policy
update_policy
via a request object, either of type
UpdatePolicyRequest or an equivalent Hash.
- 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
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).
-
policy (::Google::Cloud::BinaryAuthorization::V1beta1::Policy, ::Hash) — Required. A new or updated policy value. The service will
overwrite the policy name field with the resource name in
the request URL, in the format
projects/*/policy
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::BinaryAuthorization::V1beta1::Policy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/binary_authorization/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest.new # Call the update_policy method. result = client.update_policy request # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. p result