Module: ViprServiceCatalog
- Included in:
- Vipr
- Defined in:
- lib/vipruby/objects/servicecatalog.rb
Overview
The following Servce Catalog calls will get and execute service catalog items
Instance Method Summary collapse
-
#get_all_sc_services(auth = nil, cert = nil) ⇒ JSON
Get all services.
-
#get_sc_category_categories(cat_id, auth = nil, cert = nil) ⇒ JSON
Get all child categories of a category in ViPR.
-
#get_sc_category_categories_services(cat_id, auth = nil, cert = nil) ⇒ JSON
Get all child services of a category in ViPR.
-
#get_sc_category_root(auth = nil, cert = nil) ⇒ json
Get root category.
-
#get_sc_service(service_id, auth = nil, cert = nil) ⇒ JSON
Get Service Information.
- #order_service(tenant_id, service_urn, *args) ⇒ Object
-
#post_order_service(payload, auth = nil, cert = nil) ⇒ json
private
POST A Service Catalog Order.
Instance Method Details
#get_all_sc_services(auth = nil, cert = nil) ⇒ JSON
Get all services
33 34 35 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 33 def get_all_sc_services(auth=nil,cert=nil) rest_get("#{base_url}/catalog/services/bulk", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#get_sc_category_categories(cat_id, auth = nil, cert = nil) ⇒ JSON
Get all child categories of a category in ViPR
17 18 19 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 17 def get_sc_category_categories(cat_id,auth=nil, cert=nil) rest_get("#{@base_url}/catalog/categories/#{cat_id}/categories", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#get_sc_category_categories_services(cat_id, auth = nil, cert = nil) ⇒ JSON
Get all child services of a category in ViPR
26 27 28 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 26 def get_sc_category_categories_services(cat_id,auth=nil,cert=nil) rest_get("#{base_url}/catalog/categories/#{cat_id}/services", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#get_sc_category_root(auth = nil, cert = nil) ⇒ json
Get root category
8 9 10 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 8 def get_sc_category_root(auth=nil, cert=nil) rest_get("#{@base_url}/catalog/categories", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#get_sc_service(service_id, auth = nil, cert = nil) ⇒ JSON
Get Service Information
42 43 44 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 42 def get_sc_service(service_id, auth=nil,cert=nil) rest_get("#{base_url}/catalog/services/#{service_id}", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#order_service(tenant_id, service_urn, *args) ⇒ Object
Note:
Please read the documentation to know what parameters are needed when passing the JSON object. Every service will have it’s own set of parameters and they are unique to each service
62 63 64 65 66 67 68 69 70 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 62 def order_service(tenant_id, service_urn, *args) payload = { tenantId: tenant_id, parameters: args, catalog_service: service_urn }.to_json post_order_service(payload) end |
#post_order_service(payload, auth = nil, cert = nil) ⇒ json (private)
POST A Service Catalog Order
78 79 80 |
# File 'lib/vipruby/objects/servicecatalog.rb', line 78 def post_order_service(payload, auth=nil,cert=nil) rest_post(payload, "#{base_url}/catalog/orders", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |