Class: IbmCloudResourceController::ResourceControllerV2
- Inherits:
-
IBMCloudSdkCore::BaseService
- Object
- IBMCloudSdkCore::BaseService
- IbmCloudResourceController::ResourceControllerV2
- Includes:
- Concurrent::Async
- Defined in:
- lib/ibm_cloud_resource_controller/resource_controller_v2.rb
Overview
The resource_controller V2 service.
Constant Summary collapse
- DEFAULT_SERVICE_NAME =
"resource_controller"
- DEFAULT_SERVICE_URL =
"https://resource-controller.cloud.ibm.com"
Instance Method Summary collapse
-
#create_resource_alias(name: , source: , target: ) ⇒ IBMCloudSdkCore::DetailedResponse
Create a new resource alias.
-
#create_resource_binding(source: , target: , name: nil, parameters: nil, role: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Create a new resource binding.
-
#create_resource_instance(name: , target: , resource_group: , resource_plan_id: , tags: nil, allow_cleanup: nil, parameters: nil, entity_lock: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Create (provision) a new resource instance.
-
#create_resource_key(name: , source: , parameters: nil, role: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Create a new resource key.
-
#delete_resource_alias(id: ) ⇒ nil
Delete a resource alias.
-
#delete_resource_binding(id: ) ⇒ nil
Delete a resource binding.
-
#delete_resource_instance(id: , recursive: nil) ⇒ nil
Delete a resource instance.
-
#delete_resource_key(id: ) ⇒ nil
Delete a resource key by ID.
-
#get_resource_alias(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a resource alias.
-
#get_resource_binding(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a resource binding.
-
#get_resource_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a resource instance.
-
#get_resource_key(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get resource key by ID.
-
#initialize(args) ⇒ ResourceControllerV2
constructor
Construct a new client for the resource_controller service.
-
#list_reclamations(account_id: nil, resource_instance_id: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all reclamations.
-
#list_resource_aliases(guid: nil, name: nil, resource_instance_id: nil, region_instance_id: nil, resource_id: nil, resource_group_id: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource aliases.
-
#list_resource_aliases_for_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource aliases for the instance.
-
#list_resource_bindings(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, region_binding_id: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource bindings.
-
#list_resource_bindings_for_alias(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource bindings for the alias.
-
#list_resource_instances(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, resource_plan_id: nil, type: nil, sub_type: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource instances.
-
#list_resource_keys(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all of the resource keys.
-
#list_resource_keys_for_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all the resource keys for the instance.
-
#lock_resource_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Lock a resource instance.
-
#run_reclamation_action(id: , action_name: , request_by: nil, comment: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Perform a reclamation action.
-
#unlock_resource_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Unlock a resource instance.
-
#update_resource_alias(id: , name: ) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource alias.
-
#update_resource_binding(id: , name: ) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource binding.
-
#update_resource_instance(id: , name: nil, parameters: nil, resource_plan_id: nil, allow_cleanup: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource instance.
-
#update_resource_key(id: , name: ) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource key.
Constructor Details
#initialize(args) ⇒ ResourceControllerV2
Construct a new client for the resource_controller service.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 47 def initialize(args = {}) @__async_initialized__ = false defaults = {} defaults[:service_url] = DEFAULT_SERVICE_URL defaults[:service_name] = DEFAULT_SERVICE_NAME defaults[:authenticator] = nil user_service_url = args[:service_url] unless args[:service_url].nil? args = defaults.merge(args) super @service_url = user_service_url unless user_service_url.nil? end |
Instance Method Details
#create_resource_alias(name: , source: , target: ) ⇒ IBMCloudSdkCore::DetailedResponse
Create a new resource alias. Alias a resource instance into a targeted environment’s (name)space.
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 772 def create_resource_alias(name:, source:, target:) raise ArgumentError.new("name must be provided") if name.nil? raise ArgumentError.new("source must be provided") if source.nil? raise ArgumentError.new("target must be provided") if target.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "create_resource_alias") headers.merge!(sdk_headers) data = { "name" => name, "source" => source, "target" => target } method_url = "/v2/resource_aliases" response = request( method: "POST", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#create_resource_binding(source: , target: , name: nil, parameters: nil, role: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Create a new resource binding. Create a new resource binding.
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 599 def create_resource_binding(source:, target:, name: nil, parameters: nil, role: nil) raise ArgumentError.new("source must be provided") if source.nil? raise ArgumentError.new("target must be provided") if target.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "create_resource_binding") headers.merge!(sdk_headers) data = { "source" => source, "target" => target, "name" => name, "parameters" => parameters, "role" => role } method_url = "/v2/resource_bindings" response = request( method: "POST", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#create_resource_instance(name: , target: , resource_group: , resource_plan_id: , tags: nil, allow_cleanup: nil, parameters: nil, entity_lock: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Create (provision) a new resource instance. Provision a new resource in the specified location for the selected plan.
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 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 133 def create_resource_instance(name:, target:, resource_group:, resource_plan_id:, tags: nil, allow_cleanup: nil, parameters: nil, entity_lock: nil) raise ArgumentError.new("name must be provided") if name.nil? raise ArgumentError.new("target must be provided") if target.nil? raise ArgumentError.new("resource_group must be provided") if resource_group.nil? raise ArgumentError.new("resource_plan_id must be provided") if resource_plan_id.nil? headers = { "Entity-Lock" => entity_lock } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "create_resource_instance") headers.merge!(sdk_headers) data = { "name" => name, "target" => target, "resource_group" => resource_group, "resource_plan_id" => resource_plan_id, "tags" => , "allow_cleanup" => allow_cleanup, "parameters" => parameters } method_url = "/v2/resource_instances" response = request( method: "POST", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#create_resource_key(name: , source: , parameters: nil, role: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Create a new resource key. Create a new resource key.
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 425 def create_resource_key(name:, source:, parameters: nil, role: nil) raise ArgumentError.new("name must be provided") if name.nil? raise ArgumentError.new("source must be provided") if source.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "create_resource_key") headers.merge!(sdk_headers) data = { "name" => name, "source" => source, "parameters" => parameters, "role" => role } method_url = "/v2/resource_keys" response = request( method: "POST", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#delete_resource_alias(id: ) ⇒ nil
Delete a resource alias. Delete a resource alias by ID.
833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 833 def delete_resource_alias(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "delete_resource_alias") headers.merge!(sdk_headers) method_url = "/v2/resource_aliases/%s" % [ERB::Util.url_encode(id)] request( method: "DELETE", url: method_url, headers: headers, accept_json: false ) nil end |
#delete_resource_binding(id: ) ⇒ nil
Delete a resource binding. Delete a resource binding by ID.
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 660 def delete_resource_binding(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "delete_resource_binding") headers.merge!(sdk_headers) method_url = "/v2/resource_bindings/%s" % [ERB::Util.url_encode(id)] request( method: "DELETE", url: method_url, headers: headers, accept_json: false ) nil end |
#delete_resource_instance(id: , recursive: nil) ⇒ nil
Delete a resource instance. Delete a resource instance by ID.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 202 def delete_resource_instance(id:, recursive: nil) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "delete_resource_instance") headers.merge!(sdk_headers) params = { "recursive" => recursive } method_url = "/v2/resource_instances/%s" % [ERB::Util.url_encode(id)] request( method: "DELETE", url: method_url, headers: headers, params: params, accept_json: false ) nil end |
#delete_resource_key(id: ) ⇒ nil
Delete a resource key by ID. Delete a resource key by ID.
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 485 def delete_resource_key(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "delete_resource_key") headers.merge!(sdk_headers) method_url = "/v2/resource_keys/%s" % [ERB::Util.url_encode(id)] request( method: "DELETE", url: method_url, headers: headers, accept_json: false ) nil end |
#get_resource_alias(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a resource alias. Retrieve a resource alias by ID.
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 808 def get_resource_alias(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "get_resource_alias") headers.merge!(sdk_headers) method_url = "/v2/resource_aliases/%s" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#get_resource_binding(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a resource binding. Retrieve a resource binding by ID.
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 635 def get_resource_binding(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "get_resource_binding") headers.merge!(sdk_headers) method_url = "/v2/resource_bindings/%s" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#get_resource_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a resource instance. Retrieve a resource instance by ID.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 176 def get_resource_instance(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "get_resource_instance") headers.merge!(sdk_headers) method_url = "/v2/resource_instances/%s" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#get_resource_key(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get resource key by ID. Get resource key by ID.
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 460 def get_resource_key(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "get_resource_key") headers.merge!(sdk_headers) method_url = "/v2/resource_keys/%s" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#list_reclamations(account_id: nil, resource_instance_id: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all reclamations. Get a list of all reclamations.
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 921 def list_reclamations(account_id: nil, resource_instance_id: nil) headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_reclamations") headers.merge!(sdk_headers) params = { "account_id" => account_id, "resource_instance_id" => resource_instance_id } method_url = "/v1/reclamations" response = request( method: "GET", url: method_url, headers: headers, params: params, accept_json: true ) response end |
#list_resource_aliases(guid: nil, name: nil, resource_instance_id: nil, region_instance_id: nil, resource_id: nil, resource_group_id: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource aliases. Get a list of all resource aliases.
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 732 def list_resource_aliases(guid: nil, name: nil, resource_instance_id: nil, region_instance_id: nil, resource_id: nil, resource_group_id: nil, limit: nil, updated_from: nil, updated_to: nil) headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_aliases") headers.merge!(sdk_headers) params = { "guid" => guid, "name" => name, "resource_instance_id" => resource_instance_id, "region_instance_id" => region_instance_id, "resource_id" => resource_id, "resource_group_id" => resource_group_id, "limit" => limit, "updated_from" => updated_from, "updated_to" => updated_to } method_url = "/v2/resource_aliases" response = request( method: "GET", url: method_url, headers: headers, params: params, accept_json: true ) response end |
#list_resource_aliases_for_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource aliases for the instance. Get a list of all resource aliases for the instance.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 272 def list_resource_aliases_for_instance(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_aliases_for_instance") headers.merge!(sdk_headers) method_url = "/v2/resource_instances/%s/resource_aliases" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#list_resource_bindings(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, region_binding_id: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource bindings. Get a list of all resource bindings.
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 556 def list_resource_bindings(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, region_binding_id: nil, limit: nil, updated_from: nil, updated_to: nil) headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_bindings") headers.merge!(sdk_headers) params = { "guid" => guid, "name" => name, "resource_group_id" => resource_group_id, "resource_id" => resource_id, "region_binding_id" => region_binding_id, "limit" => limit, "updated_from" => updated_from, "updated_to" => updated_to } method_url = "/v2/resource_bindings" response = request( method: "GET", url: method_url, headers: headers, params: params, accept_json: true ) response end |
#list_resource_bindings_for_alias(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource bindings for the alias. Get a list of all resource bindings for the alias.
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 892 def list_resource_bindings_for_alias(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_bindings_for_alias") headers.merge!(sdk_headers) method_url = "/v2/resource_aliases/%s/resource_bindings" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#list_resource_instances(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, resource_plan_id: nil, type: nil, sub_type: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all resource instances. Get a list of all resource instances.
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 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 82 def list_resource_instances(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, resource_plan_id: nil, type: nil, sub_type: nil, limit: nil, updated_from: nil, updated_to: nil) headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_instances") headers.merge!(sdk_headers) params = { "guid" => guid, "name" => name, "resource_group_id" => resource_group_id, "resource_id" => resource_id, "resource_plan_id" => resource_plan_id, "type" => type, "sub_type" => sub_type, "limit" => limit, "updated_from" => updated_from, "updated_to" => updated_to } method_url = "/v2/resource_instances" response = request( method: "GET", url: method_url, headers: headers, params: params, accept_json: true ) response end |
#list_resource_keys(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, limit: nil, updated_from: nil, updated_to: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all of the resource keys. List all resource keys.
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 386 def list_resource_keys(guid: nil, name: nil, resource_group_id: nil, resource_id: nil, limit: nil, updated_from: nil, updated_to: nil) headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_keys") headers.merge!(sdk_headers) params = { "guid" => guid, "name" => name, "resource_group_id" => resource_group_id, "resource_id" => resource_id, "limit" => limit, "updated_from" => updated_from, "updated_to" => updated_to } method_url = "/v2/resource_keys" response = request( method: "GET", url: method_url, headers: headers, params: params, accept_json: true ) response end |
#list_resource_keys_for_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Get a list of all the resource keys for the instance. Get a list of all the resource keys for the instance.
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 297 def list_resource_keys_for_instance(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "list_resource_keys_for_instance") headers.merge!(sdk_headers) method_url = "/v2/resource_instances/%s/resource_keys" % [ERB::Util.url_encode(id)] response = request( method: "GET", url: method_url, headers: headers, accept_json: true ) response end |
#lock_resource_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Lock a resource instance. Locks a resource instance by ID. A locked instance can not be updated or deleted.
It does not affect actions performed on child resources like aliases, bindings or
keys.
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 324 def lock_resource_instance(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "lock_resource_instance") headers.merge!(sdk_headers) method_url = "/v2/resource_instances/%s/lock" % [ERB::Util.url_encode(id)] response = request( method: "POST", url: method_url, headers: headers, accept_json: true ) response end |
#run_reclamation_action(id: , action_name: , request_by: nil, comment: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Perform a reclamation action. Reclaim (provisionally delete) a resource so that it can no longer be used, or
restore a resource so that it's usable again.
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 955 def run_reclamation_action(id:, action_name:, request_by: nil, comment: nil) raise ArgumentError.new("id must be provided") if id.nil? raise ArgumentError.new("action_name must be provided") if action_name.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "run_reclamation_action") headers.merge!(sdk_headers) data = { "request_by" => request_by, "comment" => comment } method_url = "/v1/reclamations/%s/actions/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(action_name)] response = request( method: "POST", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#unlock_resource_instance(id: ) ⇒ IBMCloudSdkCore::DetailedResponse
Unlock a resource instance. Unlocks a resource instance by ID.
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 349 def unlock_resource_instance(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "unlock_resource_instance") headers.merge!(sdk_headers) method_url = "/v2/resource_instances/%s/lock" % [ERB::Util.url_encode(id)] response = request( method: "DELETE", url: method_url, headers: headers, accept_json: true ) response end |
#update_resource_alias(id: , name: ) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource alias. Update a resource alias by ID.
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 860 def update_resource_alias(id:, name:) raise ArgumentError.new("id must be provided") if id.nil? raise ArgumentError.new("name must be provided") if name.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "update_resource_alias") headers.merge!(sdk_headers) data = { "name" => name } method_url = "/v2/resource_aliases/%s" % [ERB::Util.url_encode(id)] response = request( method: "PATCH", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#update_resource_binding(id: , name: ) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource binding. Update a resource binding by ID.
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 687 def update_resource_binding(id:, name:) raise ArgumentError.new("id must be provided") if id.nil? raise ArgumentError.new("name must be provided") if name.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "update_resource_binding") headers.merge!(sdk_headers) data = { "name" => name } method_url = "/v2/resource_bindings/%s" % [ERB::Util.url_encode(id)] response = request( method: "PATCH", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#update_resource_instance(id: , name: nil, parameters: nil, resource_plan_id: nil, allow_cleanup: nil) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource instance. Update a resource instance by ID.
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 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 239 def update_resource_instance(id:, name: nil, parameters: nil, resource_plan_id: nil, allow_cleanup: nil) raise ArgumentError.new("id must be provided") if id.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "update_resource_instance") headers.merge!(sdk_headers) data = { "name" => name, "parameters" => parameters, "resource_plan_id" => resource_plan_id, "allow_cleanup" => allow_cleanup } method_url = "/v2/resource_instances/%s" % [ERB::Util.url_encode(id)] response = request( method: "PATCH", url: method_url, headers: headers, json: data, accept_json: true ) response end |
#update_resource_key(id: , name: ) ⇒ IBMCloudSdkCore::DetailedResponse
Update a resource key. Update a resource key by ID.
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
# File 'lib/ibm_cloud_resource_controller/resource_controller_v2.rb', line 512 def update_resource_key(id:, name:) raise ArgumentError.new("id must be provided") if id.nil? raise ArgumentError.new("name must be provided") if name.nil? headers = { } sdk_headers = Common.new.get_sdk_headers("resource_controller", "V2", "update_resource_key") headers.merge!(sdk_headers) data = { "name" => name } method_url = "/v2/resource_keys/%s" % [ERB::Util.url_encode(id)] response = request( method: "PATCH", url: method_url, headers: headers, json: data, accept_json: true ) response end |