Class: Apcera::ServicesAndBindingsApi
- Inherits:
-
Object
- Object
- Apcera::ServicesAndBindingsApi
- Defined in:
- lib/apcera/api/services_and_bindings_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#bindings_post(binding, opts = {}) ⇒ Binding
Creates a new binding between a job and a service, or between two jobs (a job link).
-
#initialize(api_client = nil) ⇒ ServicesAndBindingsApi
constructor
A new instance of ServicesAndBindingsApi.
-
#services_get(opts = {}) ⇒ Array<Service>
Lists available services.
-
#services_post(opts = {}) ⇒ Service
Creates a new service.
-
#services_uuid_delete(uuid, opts = {}) ⇒ nil
Deletes the specified service.
-
#unbind_post(job, opts = {}) ⇒ nil
Removes a service binding from a job.
Constructor Details
#initialize(api_client = nil) ⇒ ServicesAndBindingsApi
Returns a new instance of ServicesAndBindingsApi.
7 8 9 |
# File 'lib/apcera/api/services_and_bindings_api.rb', line 7 def initialize(api_client = nil) @api_client = api_client || Configuration.api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/apcera/api/services_and_bindings_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#bindings_post(binding, opts = {}) ⇒ Binding
Creates a new binding between a job and a service, or between two jobs (a job link).
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 61 62 63 64 |
# File 'lib/apcera/api/services_and_bindings_api.rb', line 17 def bindings_post(binding, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: ServicesAndBindingsApi#bindings_post ..." end # verify the required parameter 'binding' is set fail "Missing the required parameter 'binding' when calling bindings_post" if binding.nil? # resource path path = "/bindings".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(binding) 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 => 'Binding') if Configuration.debugging Configuration.logger.debug "API called: ServicesAndBindingsApi#bindings_post. Result: #{result.inspect}" end return result end |
#services_get(opts = {}) ⇒ Array<Service>
Lists available services.
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 116 117 |
# File 'lib/apcera/api/services_and_bindings_api.rb', line 72 def services_get(opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: ServicesAndBindingsApi#services_get ..." end # resource path path = "/services".sub('{format}','json') # query parameters query_params = {} query_params[:'fqn'] = opts[:'fqn'] if opts[:'fqn'] # 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<Service>') if Configuration.debugging Configuration.logger.debug "API called: ServicesAndBindingsApi#services_get. Result: #{result.inspect}" end return result end |
#services_post(opts = {}) ⇒ Service
Creates a new service.
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/services_and_bindings_api.rb', line 125 def services_post(opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: ServicesAndBindingsApi#services_post ..." end # resource path path = "/services".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(opts[:'service_request']) 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 => 'Service') if Configuration.debugging Configuration.logger.debug "API called: ServicesAndBindingsApi#services_post. Result: #{result.inspect}" end return result end |
#services_uuid_delete(uuid, opts = {}) ⇒ nil
Deletes the specified service.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/apcera/api/services_and_bindings_api.rb', line 177 def services_uuid_delete(uuid, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: ServicesAndBindingsApi#services_uuid_delete ..." end # verify the required parameter 'uuid' is set fail "Missing the required parameter 'uuid' when calling services_uuid_delete" if uuid.nil? # resource path path = "/services/{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: ServicesAndBindingsApi#services_uuid_delete" end return nil end |
#unbind_post(job, opts = {}) ⇒ nil
Removes a service binding from a job. Removes a service binding from a job.
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/apcera/api/services_and_bindings_api.rb', line 231 def unbind_post(job, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: ServicesAndBindingsApi#unbind_post ..." end # verify the required parameter 'job' is set fail "Missing the required parameter 'job' when calling unbind_post" if job.nil? # resource path path = "/unbind".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'] @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) if Configuration.debugging Configuration.logger.debug "API called: ServicesAndBindingsApi#unbind_post" end return nil end |