Class: QingCloud::SDK::TagService

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, properties) ⇒ TagService

Returns a new instance of TagService.



24
25
26
27
# File 'lib/qingcloud/sdk/service/tag.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/tag.rb', line 22

def config
  @config
end

#propertiesObject

Returns the value of attribute properties.



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

def properties
  @properties
end

Instance Method Details

#attach_tags(resource_tag_pairs: []) ⇒ Object



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

def attach_tags(resource_tag_pairs: [])
  input = {
    config:         config,
    properties:     properties,
    api_name:       'AttachTags',
    request_method: 'GET',
    request_params: {
      'resource_tag_pairs' => resource_tag_pairs,
    },
  }

  attach_tags_input_validate input

  request = Request.new input
  request.send
end

#create_tag(color: '', tag_name: '') ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/qingcloud/sdk/service/tag.rb', line 63

def create_tag(color: '', tag_name: '')
  input = {
    config:         config,
    properties:     properties,
    api_name:       'CreateTag',
    request_method: 'GET',
    request_params: {
      'color'    => color,
      'tag_name' => tag_name,
    },
  }

  create_tag_input_validate input

  request = Request.new input
  request.send
end

#delete_tags(tags: []) ⇒ Object



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

def delete_tags(tags: [])
  input = {
    config:         config,
    properties:     properties,
    api_name:       'DeleteTags',
    request_method: 'GET',
    request_params: {
      'tags' => tags,
    },
  }

  delete_tags_input_validate input

  request = Request.new input
  request.send
end

#describe_tags(limit: nil, offset: nil, search_word: '', tags: [], verbose: nil) ⇒ Object



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/qingcloud/sdk/service/tag.rb', line 120

def describe_tags(limit: nil, offset: nil, search_word: '', tags: [], verbose: nil)
  input = {
    config:         config,
    properties:     properties,
    api_name:       'DescribeTags',
    request_method: 'GET',
    request_params: {
      'limit'       => limit,
      'offset'      => offset,
      'search_word' => search_word,
      'tags'        => tags,
      'verbose'     => verbose, # verbose's available values: 0, 1
    },
  }

  describe_tags_input_validate input

  request = Request.new input
  request.send
end

#detach_tags(resource_tag_pairs: []) ⇒ Object



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/qingcloud/sdk/service/tag.rb', line 161

def detach_tags(resource_tag_pairs: [])
  input = {
    config:         config,
    properties:     properties,
    api_name:       'DetachTags',
    request_method: 'GET',
    request_params: {
      'resource_tag_pairs' => resource_tag_pairs,
    },
  }

  detach_tags_input_validate input

  request = Request.new input
  request.send
end

#modify_tag_attributes(color: '', description: '', tag: '', tag_name: '') ⇒ Object



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/qingcloud/sdk/service/tag.rb', line 194

def modify_tag_attributes(color: '', description: '', tag: '', tag_name: '')
  input = {
    config:         config,
    properties:     properties,
    api_name:       'ModifyTagAttributes',
    request_method: 'GET',
    request_params: {
      'color'       => color,
      'description' => description,
      'tag'         => tag,
      'tag_name'    => tag_name,
    },
  }

  modify_tag_attributes_input_validate input

  request = Request.new input
  request.send
end