Class: Google::Apis::BinaryauthorizationV1::BinaryAuthorizationService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::BinaryauthorizationV1::BinaryAuthorizationService
- Defined in:
- generated/google/apis/binaryauthorization_v1/service.rb
Overview
Binary Authorization API
The management interface for Binary Authorization, a system providing policy control for images deployed to Kubernetes Engine clusters.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#create_project_attestor(parent, attestor_object = nil, attestor_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Attestor
Creates an attestor, and returns a copy of the new attestor.
-
#delete_project_attestor(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Empty
Deletes an attestor.
-
#get_project_attestor(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Attestor
Gets an attestor.
-
#get_project_attestor_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Gets the access control policy for a resource.
-
#get_project_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Policy
A policy specifies the attestors that must attest to a container image, before the project is allowed to deploy that image.
-
#get_project_policy_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Gets the access control policy for a resource.
-
#initialize ⇒ BinaryAuthorizationService
constructor
A new instance of BinaryAuthorizationService.
-
#list_project_attestors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::ListAttestorsResponse
Lists attestors.
-
#set_attestor_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Sets the access control policy on the specified resource.
-
#set_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Sets the access control policy on the specified resource.
-
#test_attestor_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse
Returns permissions that a caller has on the specified resource.
-
#test_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse
Returns permissions that a caller has on the specified resource.
-
#update_project_attestor(name, attestor_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Attestor
Updates an attestor.
-
#update_project_policy(name, policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Policy
Creates or updates a project's policy, and returns a copy of the new policy.
-
#validate_attestor_attestation_occurrence(attestor, validate_attestation_occurrence_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::ValidateAttestationOccurrenceResponse
Returns whether the given Attestation for the given image URI was signed by the given Attestor.
Constructor Details
#initialize ⇒ BinaryAuthorizationService
Returns a new instance of BinaryAuthorizationService.
46 47 48 49 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 46 def initialize super('https://binaryauthorization.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
39 40 41 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 39 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
44 45 46 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 44 def quota_user @quota_user end |
Instance Method Details
#create_project_attestor(parent, attestor_object = nil, attestor_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::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.
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 148 def create_project_attestor(parent, attestor_object = nil, attestor_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/attestors', ) command.request_representation = Google::Apis::BinaryauthorizationV1::Attestor::Representation command.request_object = attestor_object command.response_representation = Google::Apis::BinaryauthorizationV1::Attestor::Representation command.response_class = Google::Apis::BinaryauthorizationV1::Attestor command.params['parent'] = parent unless parent.nil? command.query['attestorId'] = attestor_id unless attestor_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_project_attestor(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Empty
Deletes an attestor. Returns NOT_FOUND if the attestor does not exist.
182 183 184 185 186 187 188 189 190 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 182 def delete_project_attestor(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::BinaryauthorizationV1::Empty::Representation command.response_class = Google::Apis::BinaryauthorizationV1::Empty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_attestor(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Attestor
Gets an attestor. Returns NOT_FOUND if the attestor does not exist.
213 214 215 216 217 218 219 220 221 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 213 def get_project_attestor(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::BinaryauthorizationV1::Attestor::Representation command.response_class = Google::Apis::BinaryauthorizationV1::Attestor command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_attestor_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
253 254 255 256 257 258 259 260 261 262 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 253 def get_project_attestor_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', ) command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy command.params['resource'] = resource unless resource.nil? command.query['options.requestedPolicyVersion'] = unless .nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::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.
76 77 78 79 80 81 82 83 84 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 76 def get_project_policy(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::BinaryauthorizationV1::Policy::Representation command.response_class = Google::Apis::BinaryauthorizationV1::Policy command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_policy_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
477 478 479 480 481 482 483 484 485 486 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 477 def get_project_policy_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', ) command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy command.params['resource'] = resource unless resource.nil? command.query['options.requestedPolicyVersion'] = unless .nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_project_attestors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::ListAttestorsResponse
Lists attestors. Returns INVALID_ARGUMENT if the project does not exist.
292 293 294 295 296 297 298 299 300 301 302 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 292 def list_project_attestors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/attestors', ) command.response_representation = Google::Apis::BinaryauthorizationV1::ListAttestorsResponse::Representation command.response_class = Google::Apis::BinaryauthorizationV1::ListAttestorsResponse command.params['parent'] = parent unless parent.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#set_attestor_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Sets the access control policy on the specified resource. Replaces any
existing policy. Can return NOT_FOUND
, INVALID_ARGUMENT
, and
PERMISSION_DENIED
errors.
328 329 330 331 332 333 334 335 336 337 338 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 328 def set_attestor_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', ) command.request_representation = Google::Apis::BinaryauthorizationV1::SetIamPolicyRequest::Representation command.request_object = set_iam_policy_request_object command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#set_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::IamPolicy
Sets the access control policy on the specified resource. Replaces any
existing policy. Can return NOT_FOUND
, INVALID_ARGUMENT
, and
PERMISSION_DENIED
errors.
512 513 514 515 516 517 518 519 520 521 522 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 512 def set_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', ) command.request_representation = Google::Apis::BinaryauthorizationV1::SetIamPolicyRequest::Representation command.request_object = set_iam_policy_request_object command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#test_attestor_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of permissions, not a
NOT_FOUND
error. Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization checking.
This operation may "fail open" without warning.
366 367 368 369 370 371 372 373 374 375 376 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 366 def (resource, = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', ) command.request_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsRequest::Representation command.request_object = command.response_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse::Representation command.response_class = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#test_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of permissions, not a
NOT_FOUND
error. Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization checking.
This operation may "fail open" without warning.
550 551 552 553 554 555 556 557 558 559 560 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 550 def (resource, = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', ) command.request_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsRequest::Representation command.request_object = command.response_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse::Representation command.response_class = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_project_attestor(name, attestor_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::Attestor
Updates an attestor. Returns NOT_FOUND if the attestor does not exist.
400 401 402 403 404 405 406 407 408 409 410 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 400 def update_project_attestor(name, attestor_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v1/{+name}', ) command.request_representation = Google::Apis::BinaryauthorizationV1::Attestor::Representation command.request_object = attestor_object command.response_representation = Google::Apis::BinaryauthorizationV1::Attestor::Representation command.response_class = Google::Apis::BinaryauthorizationV1::Attestor command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_project_policy(name, policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::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.
111 112 113 114 115 116 117 118 119 120 121 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 111 def update_project_policy(name, policy_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v1/{+name}', ) command.request_representation = Google::Apis::BinaryauthorizationV1::Policy::Representation command.request_object = policy_object command.response_representation = Google::Apis::BinaryauthorizationV1::Policy::Representation command.response_class = Google::Apis::BinaryauthorizationV1::Policy command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#validate_attestor_attestation_occurrence(attestor, validate_attestation_occurrence_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1::ValidateAttestationOccurrenceResponse
Returns whether the given Attestation for the given image URI was signed by the given Attestor
435 436 437 438 439 440 441 442 443 444 445 |
# File 'generated/google/apis/binaryauthorization_v1/service.rb', line 435 def validate_attestor_attestation_occurrence(attestor, validate_attestation_occurrence_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+attestor}:validateAttestationOccurrence', ) command.request_representation = Google::Apis::BinaryauthorizationV1::ValidateAttestationOccurrenceRequest::Representation command.request_object = validate_attestation_occurrence_request_object command.response_representation = Google::Apis::BinaryauthorizationV1::ValidateAttestationOccurrenceResponse::Representation command.response_class = Google::Apis::BinaryauthorizationV1::ValidateAttestationOccurrenceResponse command.params['attestor'] = attestor unless attestor.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |