lib/3scale/api/client.rb in 3scale-api-0.1.6 vs lib/3scale/api/client.rb in 3scale-api-0.1.7
- old
+ new
@@ -23,10 +23,17 @@
response = http_client.get('/admin/api/services')
extract(collection: 'services', entity: 'service', from: response)
end
# @api public
+ # @param [Fixnum] id Service ID
+ def delete_service(id)
+ http_client.delete("/admin/api/services/#{id}")
+ true
+ end
+
+ # @api public
# @return [Array<Hash>]
# @param [Fixnum] service_id Service ID
def list_applications(service_id: nil)
params = service_id ? { service_id: service_id } : nil
response = http_client.get('/admin/api/applications', params: params)
@@ -238,9 +245,19 @@
# @option attributes [String] :name Application Plan Name
def create_application_plan(service_id, attributes)
response = http_client.post("/admin/api/services/#{service_id}/application_plans",
body: { application_plan: attributes })
extract(entity: 'application_plan', from: response)
+ end
+
+
+ # @api public
+ # @return [Bool]
+ # @param [Fixnum] service_id Service ID
+ # @param [Fixnum] application_plan_id Application Plan ID
+ def delete_application_plan(service_id,application_plan_id)
+ http_client.delete("/admin/api/services/#{service_id}/application_plans/#{application_plan_id}")
+ true
end
# @api public
# @return [Array<Hash>]
# @param [Fixnum] application_plan_id Application Plan ID