Class: Google::Apis::CloudprofilerV2::CloudProfilerService

Inherits:
Google::Apis::Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/cloudprofiler_v2/service.rb

Overview

Cloud Profiler API

Manages continuous profiling information.

Examples:

require 'google/apis/cloudprofiler_v2'

Cloudprofiler = Google::Apis::CloudprofilerV2 # Alias the module
service = Cloudprofiler::CloudProfilerService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://cloudprofiler.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCloudProfilerService

Returns a new instance of CloudProfilerService.



47
48
49
50
51
52
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-cloudprofiler_v2',
        client_version: Google::Apis::CloudprofilerV2::GEM_VERSION)
  @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.



40
41
42
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 40

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.



45
46
47
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#create_profile(parent, create_profile_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudprofilerV2::Profile

CreateProfile creates a new profile resource in the online mode. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named " google.rpc.retryinfo-bin".

Parameters:

  • parent (String)

    Parent project to create the profile in.

  • create_profile_request_object (Google::Apis::CloudprofilerV2::CreateProfileRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 86

def create_profile(parent, create_profile_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/profiles', options)
  command.request_representation = Google::Apis::CloudprofilerV2::CreateProfileRequest::Representation
  command.request_object = create_profile_request_object
  command.response_representation = Google::Apis::CloudprofilerV2::Profile::Representation
  command.response_class = Google::Apis::CloudprofilerV2::Profile
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_profile_offline(parent, profile_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudprofilerV2::Profile

CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection.

Parameters:

  • parent (String)

    Parent project to create the profile in.

  • profile_object (Google::Apis::CloudprofilerV2::Profile) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 123

def create_project_profile_offline(parent, profile_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/profiles:createOffline', options)
  command.request_representation = Google::Apis::CloudprofilerV2::Profile::Representation
  command.request_object = profile_object
  command.response_representation = Google::Apis::CloudprofilerV2::Profile::Representation
  command.response_class = Google::Apis::CloudprofilerV2::Profile
  command.params['parent'] = parent unless parent.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_profiles(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudprofilerV2::ListProfilesResponse

Lists profiles which have been collected so far and for which the caller has permission to view.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of profiles. Format: projects/ user_project_id

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of items to return. Default page_size is 1000. Max limit is 1000.

  • page_token (String) (defaults to: nil)

    Optional. The token to continue pagination and get profiles from a particular page. When paginating, all other parameters provided to ListProfiles must match the call that provided the page token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



164
165
166
167
168
169
170
171
172
173
174
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 164

def list_project_profiles(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/profiles', options)
  command.response_representation = Google::Apis::CloudprofilerV2::ListProfilesResponse::Representation
  command.response_class = Google::Apis::CloudprofilerV2::ListProfilesResponse
  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

#patch_project_profile(name, profile_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudprofilerV2::Profile

UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection.

Parameters:

  • name (String)

    Output only. Opaque, server-assigned, unique ID for this profile.

  • profile_object (Google::Apis::CloudprofilerV2::Profile) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Field mask used to specify the fields to be overwritten. Currently only profile_bytes and labels fields are supported by UpdateProfile, so only those fields can be specified in the mask. When no mask is provided, all fields are overwritten.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/google/apis/cloudprofiler_v2/service.rb', line 207

def patch_project_profile(name, profile_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::CloudprofilerV2::Profile::Representation
  command.request_object = profile_object
  command.response_representation = Google::Apis::CloudprofilerV2::Profile::Representation
  command.response_class = Google::Apis::CloudprofilerV2::Profile
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end