Class: IBM::Cloud::SDK::BaseService

Inherits:
Object
  • Object
show all
Defined in:
lib/ibm/cloud/sdk/base_service.rb

Direct Known Subclasses

IAM, PowerIaas, ResourceController

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.endpointObject

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/ibm/cloud/sdk/base_service.rb', line 5

def self.endpoint
  raise NotImplementedError
end

Instance Method Details

#delete(path) ⇒ Object



13
14
15
# File 'lib/ibm/cloud/sdk/base_service.rb', line 13

def delete(path)
  JSON.parse(RestClient.delete(url(path), headers))
end

#endpointObject

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/ibm/cloud/sdk/base_service.rb', line 9

def endpoint
  raise NotImplementedError
end

#get(path) ⇒ Object



17
18
19
# File 'lib/ibm/cloud/sdk/base_service.rb', line 17

def get(path)
  JSON.parse(RestClient.get(url(path), headers))
end

#post(path, payload) ⇒ Object



21
22
23
# File 'lib/ibm/cloud/sdk/base_service.rb', line 21

def post(path, payload)
  JSON.parse(RestClient.post(url(path), payload, headers))
end