Class: Apcera::ProvidersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/apcera/api/providers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ ProvidersApi

Returns a new instance of ProvidersApi.



7
8
9
# File 'lib/apcera/api/providers_api.rb', line 7

def initialize(api_client = nil)
  @api_client = api_client || Configuration.api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/apcera/api/providers_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#providers_get(opts = {}) ⇒ Array<Provider>

Returns a list of providers defined on the cluster. Returns a list of providers defined on the cluster.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/apcera/api/providers_api.rb', line 16

def providers_get(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ProvidersApi#providers_get ..."
  end
  
  
  # resource path
  path = "/providers".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  result = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Provider>')
  if Configuration.debugging
    Configuration.logger.debug "API called: ProvidersApi#providers_get. Result: #{result.inspect}"
  end
  return result
end

#providers_post(job, opts = {}) ⇒ Array<Provider>

Creates a new provider. Creates a new provider.

Parameters:

  • job

    An object that defines the properties of the new provider.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/apcera/api/providers_api.rb', line 68

def providers_post(job, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ProvidersApi#providers_post ..."
  end
  
  
  # verify the required parameter 'job' is set
  fail "Missing the required parameter 'job' when calling providers_post" if job.nil?
  
  # resource path
  path = "/providers".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(job)
  

  auth_names = ['authorization']
  result = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Provider>')
  if Configuration.debugging
    Configuration.logger.debug "API called: ProvidersApi#providers_post. Result: #{result.inspect}"
  end
  return result
end

#providers_uuid_delete(uuid, opts = {}) ⇒ nil

Deletes the specified provider. Deletes the specified provider.

Parameters:

  • uuid

    UUID of the provider to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/apcera/api/providers_api.rb', line 123

def providers_uuid_delete(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ProvidersApi#providers_uuid_delete ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling providers_uuid_delete" if uuid.nil?
  
  # resource path
  path = "/providers/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  @api_client.call_api(:DELETE, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: ProvidersApi#providers_uuid_delete"
  end
  return nil
end