Class: Google::Apis::ComputeV1::Operation

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/compute_v1/classes.rb,
lib/google/apis/compute_v1/representations.rb,
lib/google/apis/compute_v1/representations.rb

Overview

Represents an Operation resource. Google Compute Engine has three Operation resources:

  • Global
  • Regional
  • Zonal You can use an operation resource to manage asynchronous API requests. For more information, readHandling API responses. Operations can be global, regional or zonal.

  • For global operations, use the globalOperations resource.

  • For regional operations, use the regionOperations resource.

  • For zonal operations, use the zoneOperations resource. For more information, read Global, Regional, and Zonal Resources. Note that completed Operation resources have a limited retention period.

Defined Under Namespace

Classes: Error, Warning

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Operation

Returns a new instance of Operation.



36481
36482
36483
# File 'lib/google/apis/compute_v1/classes.rb', line 36481

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#client_operation_idString

[Output Only] The value of requestId if you provided it in the request. Not present otherwise. Corresponds to the JSON property clientOperationId

Returns:

  • (String)


36319
36320
36321
# File 'lib/google/apis/compute_v1/classes.rb', line 36319

def client_operation_id
  @client_operation_id
end

#creation_timestampString

[Deprecated] This field is deprecated. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


36324
36325
36326
# File 'lib/google/apis/compute_v1/classes.rb', line 36324

def creation_timestamp
  @creation_timestamp
end

#descriptionString

[Output Only] A textual description of the operation, which is set when the operation is created. Corresponds to the JSON property description

Returns:

  • (String)


36330
36331
36332
# File 'lib/google/apis/compute_v1/classes.rb', line 36330

def description
  @description
end

#end_timeString

[Output Only] The time that this operation was completed. This value is inRFC3339 text format. Corresponds to the JSON property endTime

Returns:

  • (String)


36337
36338
36339
# File 'lib/google/apis/compute_v1/classes.rb', line 36337

def end_time
  @end_time
end

#errorGoogle::Apis::ComputeV1::Operation::Error

[Output Only] If errors are generated during processing of the operation, this field will be populated. Corresponds to the JSON property error



36343
36344
36345
# File 'lib/google/apis/compute_v1/classes.rb', line 36343

def error
  @error
end

#http_error_messageString

[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. Corresponds to the JSON property httpErrorMessage

Returns:

  • (String)


36349
36350
36351
# File 'lib/google/apis/compute_v1/classes.rb', line 36349

def http_error_message
  @http_error_message
end

#http_error_status_codeFixnum

[Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found. Corresponds to the JSON property httpErrorStatusCode

Returns:

  • (Fixnum)


36356
36357
36358
# File 'lib/google/apis/compute_v1/classes.rb', line 36356

def http_error_status_code
  @http_error_status_code
end

#idFixnum

[Output Only] The unique identifier for the operation. This identifier is defined by the server. Corresponds to the JSON property id

Returns:

  • (Fixnum)


36362
36363
36364
# File 'lib/google/apis/compute_v1/classes.rb', line 36362

def id
  @id
end

#insert_timeString

[Output Only] The time that this operation was requested. This value is inRFC3339 text format. Corresponds to the JSON property insertTime

Returns:

  • (String)


36369
36370
36371
# File 'lib/google/apis/compute_v1/classes.rb', line 36369

def insert_time
  @insert_time
end

#instances_bulk_insert_operation_metadataGoogle::Apis::ComputeV1::InstancesBulkInsertOperationMetadata

Corresponds to the JSON property instancesBulkInsertOperationMetadata



36374
36375
36376
# File 'lib/google/apis/compute_v1/classes.rb', line 36374

def 
  @instances_bulk_insert_operation_metadata
end

#kindString

Output only. [Output Only] Type of the resource. Always compute#operation for Operation resources. Corresponds to the JSON property kind

Returns:

  • (String)


36381
36382
36383
# File 'lib/google/apis/compute_v1/classes.rb', line 36381

def kind
  @kind
end

#nameString

[Output Only] Name of the operation. Corresponds to the JSON property name

Returns:

  • (String)


36386
36387
36388
# File 'lib/google/apis/compute_v1/classes.rb', line 36386

def name
  @name
end

#operation_group_idString

Output only. [Output Only] An ID that represents a group of operations, such as when a group of operations results from a bulkInsert API request. Corresponds to the JSON property operationGroupId

Returns:

  • (String)


36393
36394
36395
# File 'lib/google/apis/compute_v1/classes.rb', line 36393

def operation_group_id
  @operation_group_id
end

#operation_typeString

[Output Only] The type of operation, such as insert, update, or delete, and so on. Corresponds to the JSON property operationType

Returns:

  • (String)


36399
36400
36401
# File 'lib/google/apis/compute_v1/classes.rb', line 36399

def operation_type
  @operation_type
end

#progressFixnum

[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. Corresponds to the JSON property progress

Returns:

  • (Fixnum)


36408
36409
36410
# File 'lib/google/apis/compute_v1/classes.rb', line 36408

def progress
  @progress
end

#regionString

[Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. Corresponds to the JSON property region

Returns:

  • (String)


36414
36415
36416
# File 'lib/google/apis/compute_v1/classes.rb', line 36414

def region
  @region
end

[Output Only] Server-defined URL for the resource. Corresponds to the JSON property selfLink

Returns:

  • (String)


36419
36420
36421
# File 'lib/google/apis/compute_v1/classes.rb', line 36419

def self_link
  @self_link
end

#set_common_instance_metadata_operation_metadataGoogle::Apis::ComputeV1::SetCommonInstanceMetadataOperationMetadata

Output only. [Output Only] If the operation is for projects. setCommonInstanceMetadata, this field will contain information on all underlying zonal actions and their state. Corresponds to the JSON property setCommonInstanceMetadataOperationMetadata



36427
36428
36429
# File 'lib/google/apis/compute_v1/classes.rb', line 36427

def 
  @set_common_instance_metadata_operation_metadata
end

#start_timeString

[Output Only] The time that this operation was started by the server. This value is inRFC3339 text format. Corresponds to the JSON property startTime

Returns:

  • (String)


36434
36435
36436
# File 'lib/google/apis/compute_v1/classes.rb', line 36434

def start_time
  @start_time
end

#statusString

[Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. Corresponds to the JSON property status

Returns:

  • (String)


36441
36442
36443
# File 'lib/google/apis/compute_v1/classes.rb', line 36441

def status
  @status
end

#status_messageString

[Output Only] An optional textual description of the current status of the operation. Corresponds to the JSON property statusMessage

Returns:

  • (String)


36447
36448
36449
# File 'lib/google/apis/compute_v1/classes.rb', line 36447

def status_message
  @status_message
end

#target_idFixnum

[Output Only] The unique target ID, which identifies a specific incarnation of the target resource. Corresponds to the JSON property targetId

Returns:

  • (Fixnum)


36453
36454
36455
# File 'lib/google/apis/compute_v1/classes.rb', line 36453

def target_id
  @target_id
end

[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the disk that the snapshot was created from. Corresponds to the JSON property targetLink

Returns:

  • (String)


36460
36461
36462
# File 'lib/google/apis/compute_v1/classes.rb', line 36460

def target_link
  @target_link
end

#userString

[Output Only] User who requested the operation, for example: user@example.com or alice_smith_identifier (global/workforcePools/example-com-us-employees). Corresponds to the JSON property user

Returns:

  • (String)


36467
36468
36469
# File 'lib/google/apis/compute_v1/classes.rb', line 36467

def user
  @user
end

#warningsArray<Google::Apis::ComputeV1::Operation::Warning>

[Output Only] If warning messages are generated during processing of the operation, this field will be populated. Corresponds to the JSON property warnings



36473
36474
36475
# File 'lib/google/apis/compute_v1/classes.rb', line 36473

def warnings
  @warnings
end

#zoneString

[Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. Corresponds to the JSON property zone

Returns:

  • (String)


36479
36480
36481
# File 'lib/google/apis/compute_v1/classes.rb', line 36479

def zone
  @zone
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



36486
36487
36488
36489
36490
36491
36492
36493
36494
36495
36496
36497
36498
36499
36500
36501
36502
36503
36504
36505
36506
36507
36508
36509
36510
36511
36512
36513
# File 'lib/google/apis/compute_v1/classes.rb', line 36486

def update!(**args)
  @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @description = args[:description] if args.key?(:description)
  @end_time = args[:end_time] if args.key?(:end_time)
  @error = args[:error] if args.key?(:error)
  @http_error_message = args[:http_error_message] if args.key?(:http_error_message)
  @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)
  @id = args[:id] if args.key?(:id)
  @insert_time = args[:insert_time] if args.key?(:insert_time)
  @instances_bulk_insert_operation_metadata = args[:instances_bulk_insert_operation_metadata] if args.key?(:instances_bulk_insert_operation_metadata)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @operation_group_id = args[:operation_group_id] if args.key?(:operation_group_id)
  @operation_type = args[:operation_type] if args.key?(:operation_type)
  @progress = args[:progress] if args.key?(:progress)
  @region = args[:region] if args.key?(:region)
  @self_link = args[:self_link] if args.key?(:self_link)
  @set_common_instance_metadata_operation_metadata = args[:set_common_instance_metadata_operation_metadata] if args.key?(:set_common_instance_metadata_operation_metadata)
  @start_time = args[:start_time] if args.key?(:start_time)
  @status = args[:status] if args.key?(:status)
  @status_message = args[:status_message] if args.key?(:status_message)
  @target_id = args[:target_id] if args.key?(:target_id)
  @target_link = args[:target_link] if args.key?(:target_link)
  @user = args[:user] if args.key?(:user)
  @warnings = args[:warnings] if args.key?(:warnings)
  @zone = args[:zone] if args.key?(:zone)
end