Class: Google::Apis::BinaryauthorizationV1beta1::BinaryAuthorizationService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
generated/google/apis/binaryauthorization_v1beta1/service.rb

Overview

Binary Authorization API

The management interface for Binary Authorization, a system providing policy control for images deployed to Kubernetes Engine clusters.

Examples:

require 'google/apis/binaryauthorization_v1beta1'

Binaryauthorization = Google::Apis::BinaryauthorizationV1beta1 # Alias the module
service = Binaryauthorization::BinaryAuthorizationService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeBinaryAuthorizationService

Returns a new instance of BinaryAuthorizationService



46
47
48
49
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 46

def initialize
  super('https://binaryauthorization.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

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.

Returns:

  • (String)

    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_v1beta1/service.rb', line 39

def key
  @key
end

#quota_userString

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.

Returns:

  • (String)

    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_v1beta1/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::BinaryauthorizationV1beta1::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.

Parameters:

  • parent (String)

    Required. The parent of this attestor.

  • attestor_object (Google::Apis::BinaryauthorizationV1beta1::Attestor) (defaults to: nil)
  • attestor_id (String)

    Required. The attestors ID.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



147
148
149
150
151
152
153
154
155
156
157
158
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 147

def create_project_attestor(parent, attestor_object = nil, attestor_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1beta1/{+parent}/attestors', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
  command.request_object = attestor_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::Empty

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

Parameters:

  • name (String)

    Required. The name of the attestors to delete, in the format projects/*/attestors/*.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



182
183
184
185
186
187
188
189
190
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 182

def delete_project_attestor(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Empty::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::Attestor

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

Parameters:

  • name (String)

    Required. The name of the attestor to retrieve, in the format projects/*/attestors/*.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



214
215
216
217
218
219
220
221
222
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 214

def get_project_attestor(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1beta1::IamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



247
248
249
250
251
252
253
254
255
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 247

def get_project_attestor_iam_policy(resource, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1beta1/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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

#get_project_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1beta1::Policy

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

Parameters:

  • name (String)

    Required. The resource name of the policy to retrieve, in the format projects/*/policy.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



73
74
75
76
77
78
79
80
81
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 73

def get_project_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Policy::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1beta1::IamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



430
431
432
433
434
435
436
437
438
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 430

def get_project_policy_iam_policy(resource, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1beta1/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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

#list_project_attestors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BinaryauthorizationV1beta1::ListAttestorsResponse

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

Parameters:

  • parent (String)

    Required. The resource name of the project associated with the attestors, in the format projects/*.

  • page_size (Fixnum)

    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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



286
287
288
289
290
291
292
293
294
295
296
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 286

def list_project_attestors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1beta1/{+parent}/attestors', options)
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::ListAttestorsResponse::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::IamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



321
322
323
324
325
326
327
328
329
330
331
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 321

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, 'v1beta1/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::IamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



463
464
465
466
467
468
469
470
471
472
473
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 463

def set_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1beta1/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



360
361
362
363
364
365
366
367
368
369
370
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 360

def test_attestor_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1beta1/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



502
503
504
505
506
507
508
509
510
511
512
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 502

def test_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1beta1/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::Attestor

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

Parameters:

  • name (String)

    Required. The resource name, in the format: projects/*/attestors/*. This field may not be updated.

  • attestor_object (Google::Apis::BinaryauthorizationV1beta1::Attestor) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



395
396
397
398
399
400
401
402
403
404
405
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 395

def update_project_attestor(name, attestor_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:put, 'v1beta1/{+name}', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
  command.request_object = attestor_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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::BinaryauthorizationV1beta1::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.

Parameters:

  • name (String)

    Output only. The resource name, in the format projects/*/policy. There is at most one policy per project.

  • policy_object (Google::Apis::BinaryauthorizationV1beta1::Policy) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



109
110
111
112
113
114
115
116
117
118
119
# File 'generated/google/apis/binaryauthorization_v1beta1/service.rb', line 109

def update_project_policy(name, policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:put, 'v1beta1/{+name}', options)
  command.request_representation = Google::Apis::BinaryauthorizationV1beta1::Policy::Representation
  command.request_object = policy_object
  command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Policy::Representation
  command.response_class = Google::Apis::BinaryauthorizationV1beta1::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