Class: QingCloud::SDK::SnapshotService

Inherits:
Object
  • Object
show all
Defined in:
lib/qingcloud/sdk/service/snapshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, properties) ⇒ SnapshotService

Returns a new instance of SnapshotService.



24
25
26
27
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 24

def initialize(config, properties)
  self.config     = config
  self.properties = properties.deep_symbolize_keys
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



22
23
24
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 22

def config
  @config
end

#propertiesObject

Returns the value of attribute properties.



22
23
24
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 22

def properties
  @properties
end

Instance Method Details

#apply_snapshots(snapshots: []) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 30

def apply_snapshots(snapshots: [])
  input = {
    config:         config,
    properties:     properties,
    api_name:       'ApplySnapshots',
    request_method: 'GET',
    request_params: {
      'snapshots' => snapshots,
    },
  }

  apply_snapshots_input_validate input

  request = Request.new input
  request.send
end

#capture_instance_from_snapshot(image_name: '', snapshot: '') ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 60

def capture_instance_from_snapshot(image_name: '', snapshot: '')
  input = {
    config:         config,
    properties:     properties,
    api_name:       'CaptureInstanceFromSnapshot',
    request_method: 'GET',
    request_params: {
      'image_name' => image_name,
      'snapshot'   => snapshot,
    },
  }

  capture_instance_from_snapshot_input_validate input

  request = Request.new input
  request.send
end

#create_snapshots(is_full: nil, resources: [], snapshot_name: '') ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 91

def create_snapshots(is_full: nil, resources: [], snapshot_name: '')
  input = {
    config:         config,
    properties:     properties,
    api_name:       'CreateSnapshots',
    request_method: 'GET',
    request_params: {
      'is_full'       => is_full, # is_full's available values: 0, 1
      'resources'     => resources,
      'snapshot_name' => snapshot_name,
    },
  }

  create_snapshots_input_validate input

  request = Request.new input
  request.send
end

#create_volume_from_snapshot(snapshot: '', volume_name: '') ⇒ Object



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 134

def create_volume_from_snapshot(snapshot: '', volume_name: '')
  input = {
    config:         config,
    properties:     properties,
    api_name:       'CreateVolumeFromSnapshot',
    request_method: 'GET',
    request_params: {
      'snapshot'    => snapshot,
      'volume_name' => volume_name,
    },
  }

  create_volume_from_snapshot_input_validate input

  request = Request.new input
  request.send
end

#delete_snapshots(snapshots: []) ⇒ Object



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 165

def delete_snapshots(snapshots: [])
  input = {
    config:         config,
    properties:     properties,
    api_name:       'DeleteSnapshots',
    request_method: 'GET',
    request_params: {
      'snapshots' => snapshots,
    },
  }

  delete_snapshots_input_validate input

  request = Request.new input
  request.send
end

#describe_snapshots(limit: nil, offset: nil, resource_id: '', search_word: '', snapshot_type: nil, snapshots: [], status: [], tags: [], verbose: nil) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 195

def describe_snapshots(limit: nil, offset: nil, resource_id: '', search_word: '', snapshot_type: nil, snapshots: [], status: [], tags: [], verbose: nil)
  input = {
    config:         config,
    properties:     properties,
    api_name:       'DescribeSnapshots',
    request_method: 'GET',
    request_params: {
      'limit'         => limit,
      'offset'        => offset,
      'resource_id'   => resource_id,
      'search_word'   => search_word,
      'snapshot_type' => snapshot_type, # snapshot_type's available values: 0, 1
      'snapshots'     => snapshots,
      'status'        => status,
      'tags'          => tags,
      'verbose'       => verbose, # verbose's available values: 0, 1
    },
  }

  describe_snapshots_input_validate input

  request = Request.new input
  request.send
end

#modify_snapshot_attributes(description: '', snapshot: '', snapshot_name: '') ⇒ Object



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/qingcloud/sdk/service/snapshot.rb', line 251

def modify_snapshot_attributes(description: '', snapshot: '', snapshot_name: '')
  input = {
    config:         config,
    properties:     properties,
    api_name:       'ModifySnapshotAttributes',
    request_method: 'GET',
    request_params: {
      'description'   => description,
      'snapshot'      => snapshot,
      'snapshot_name' => snapshot_name,
    },
  }

  modify_snapshot_attributes_input_validate input

  request = Request.new input
  request.send
end