Module: Idcf::Ilb::ClientExtensions::Config
- Included in:
- Idcf::Ilb::Client
- Defined in:
- lib/idcf/ilb/client_extensions/config.rb
Overview
SDK APIs for config resource
Instance Method Summary collapse
-
#configs(lb_id, headers = {}) ⇒ Array<Resources::Config>
Get an array of existing config objects.
-
#create_config(lb_id, attributes, headers = {}) ⇒ Response
Create a new loadbalancer config.
-
#delete_config(lb_id, id, headers = {}) ⇒ Boolean
Delete a config.
-
#get_config(lb_id, id, headers = {}) ⇒ Response
Get a config.
-
#list_configs(lb_id, headers = {}) ⇒ Response
Get list of existing configs.
-
#patch_config(lb_id, id, attributes, headers = {}) ⇒ Response
Patch a config.
Instance Method Details
#configs(lb_id, headers = {}) ⇒ Array<Resources::Config>
Get an array of existing config objects.
89 90 91 92 93 |
# File 'lib/idcf/ilb/client_extensions/config.rb', line 89 def configs(lb_id, headers = {}) list_configs(lb_id, headers).resources.map do |config| Resources::Config.new(self, config) end end |
#create_config(lb_id, attributes, headers = {}) ⇒ Response
Create a new loadbalancer config.
23 24 25 26 27 |
# File 'lib/idcf/ilb/client_extensions/config.rb', line 23 def create_config(lb_id, attributes, headers = {}) Validators::Config.validate_attributes!(attributes, :create) res = post!("loadbalancers/#{lb_id}/configs", attributes, headers) check_job(res.body["job_id"], headers, ["get_config", lb_id]) end |
#delete_config(lb_id, id, headers = {}) ⇒ Boolean
Delete a config
79 80 81 82 |
# File 'lib/idcf/ilb/client_extensions/config.rb', line 79 def delete_config(lb_id, id, headers = {}) res = delete!("loadbalancers/#{lb_id}/configs/#{id}", {}, headers) check_job(res.body["job_id"], headers) end |
#get_config(lb_id, id, headers = {}) ⇒ Response
Get a config
44 45 46 |
# File 'lib/idcf/ilb/client_extensions/config.rb', line 44 def get_config(lb_id, id, headers = {}) get!("loadbalancers/#{lb_id}/configs/#{id}", {}, headers) end |
#list_configs(lb_id, headers = {}) ⇒ Response
Get list of existing configs
34 35 36 |
# File 'lib/idcf/ilb/client_extensions/config.rb', line 34 def list_configs(lb_id, headers = {}) get!("loadbalancers/#{lb_id}/configs", {}, headers) end |
#patch_config(lb_id, id, attributes, headers = {}) ⇒ Response
Patch a config
67 68 69 70 71 |
# File 'lib/idcf/ilb/client_extensions/config.rb', line 67 def patch_config(lb_id, id, attributes, headers = {}) Validators::Config.validate_attributes!(attributes, :patch) res = patch!("loadbalancers/#{lb_id}/configs/#{id}", attributes, headers) check_job(res.body["job_id"], headers, ["get_config", lb_id]) end |