ibm_cloud_resource_controller 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +148 -0
- data/Rakefile +10 -0
- data/docs/Credentials.md +25 -0
- data/docs/ErrorReport.md +23 -0
- data/docs/PlanHistoryItem.md +19 -0
- data/docs/Reclamation.md +45 -0
- data/docs/ReclamationActionsPost.md +19 -0
- data/docs/ReclamationsList.md +17 -0
- data/docs/ResourceAlias.md +57 -0
- data/docs/ResourceAliasPatch.md +17 -0
- data/docs/ResourceAliasPost.md +21 -0
- data/docs/ResourceAliasesApi.md +302 -0
- data/docs/ResourceAliasesList.md +21 -0
- data/docs/ResourceBinding.md +57 -0
- data/docs/ResourceBindingPatch.md +17 -0
- data/docs/ResourceBindingPost.md +25 -0
- data/docs/ResourceBindingPostParameters.md +17 -0
- data/docs/ResourceBindingsApi.md +300 -0
- data/docs/ResourceBindingsList.md +21 -0
- data/docs/ResourceInstance.md +81 -0
- data/docs/ResourceInstancePatch.md +23 -0
- data/docs/ResourceInstancePost.md +29 -0
- data/docs/ResourceInstancesApi.md +418 -0
- data/docs/ResourceInstancesList.md +21 -0
- data/docs/ResourceKey.md +53 -0
- data/docs/ResourceKeyPatch.md +17 -0
- data/docs/ResourceKeyPost.md +23 -0
- data/docs/ResourceKeysApi.md +298 -0
- data/docs/ResourceKeysList.md +21 -0
- data/docs/ResourceReclamationsApi.md +128 -0
- data/git_push.sh +58 -0
- data/ibm_cloud_resource_controller.gemspec +38 -0
- data/lib/ibm_cloud_resource_controller.rb +67 -0
- data/lib/ibm_cloud_resource_controller/api/resource_aliases_api.rb +363 -0
- data/lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb +360 -0
- data/lib/ibm_cloud_resource_controller/api/resource_instances_api.rb +493 -0
- data/lib/ibm_cloud_resource_controller/api/resource_keys_api.rb +357 -0
- data/lib/ibm_cloud_resource_controller/api/resource_reclamations_api.rb +156 -0
- data/lib/ibm_cloud_resource_controller/api_client.rb +388 -0
- data/lib/ibm_cloud_resource_controller/api_error.rb +57 -0
- data/lib/ibm_cloud_resource_controller/configuration.rb +248 -0
- data/lib/ibm_cloud_resource_controller/models/credentials.rb +250 -0
- data/lib/ibm_cloud_resource_controller/models/error_report.rb +240 -0
- data/lib/ibm_cloud_resource_controller/models/plan_history_item.rb +230 -0
- data/lib/ibm_cloud_resource_controller/models/reclamation.rb +352 -0
- data/lib/ibm_cloud_resource_controller/models/reclamation_actions_post.rb +220 -0
- data/lib/ibm_cloud_resource_controller/models/reclamations_list.rb +212 -0
- data/lib/ibm_cloud_resource_controller/models/resource_alias.rb +410 -0
- data/lib/ibm_cloud_resource_controller/models/resource_alias_patch.rb +236 -0
- data/lib/ibm_cloud_resource_controller/models/resource_alias_post.rb +266 -0
- data/lib/ibm_cloud_resource_controller/models/resource_aliases_list.rb +247 -0
- data/lib/ibm_cloud_resource_controller/models/resource_binding.rb +410 -0
- data/lib/ibm_cloud_resource_controller/models/resource_binding_patch.rb +236 -0
- data/lib/ibm_cloud_resource_controller/models/resource_binding_post.rb +278 -0
- data/lib/ibm_cloud_resource_controller/models/resource_binding_post_parameters.rb +210 -0
- data/lib/ibm_cloud_resource_controller/models/resource_bindings_list.rb +247 -0
- data/lib/ibm_cloud_resource_controller/models/resource_instance.rb +536 -0
- data/lib/ibm_cloud_resource_controller/models/resource_instance_patch.rb +259 -0
- data/lib/ibm_cloud_resource_controller/models/resource_instance_post.rb +317 -0
- data/lib/ibm_cloud_resource_controller/models/resource_instances_list.rb +247 -0
- data/lib/ibm_cloud_resource_controller/models/resource_key.rb +390 -0
- data/lib/ibm_cloud_resource_controller/models/resource_key_patch.rb +236 -0
- data/lib/ibm_cloud_resource_controller/models/resource_key_post.rb +251 -0
- data/lib/ibm_cloud_resource_controller/models/resource_keys_list.rb +247 -0
- data/lib/ibm_cloud_resource_controller/version.rb +15 -0
- data/spec/api/resource_aliases_api_spec.rb +104 -0
- data/spec/api/resource_bindings_api_spec.rb +103 -0
- data/spec/api/resource_instances_api_spec.rb +130 -0
- data/spec/api/resource_keys_api_spec.rb +102 -0
- data/spec/api/resource_reclamations_api_spec.rb +62 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/credentials_spec.rb +65 -0
- data/spec/models/error_report_spec.rb +59 -0
- data/spec/models/plan_history_item_spec.rb +47 -0
- data/spec/models/reclamation_actions_post_spec.rb +47 -0
- data/spec/models/reclamation_spec.rb +125 -0
- data/spec/models/reclamations_list_spec.rb +41 -0
- data/spec/models/resource_alias_patch_spec.rb +41 -0
- data/spec/models/resource_alias_post_spec.rb +53 -0
- data/spec/models/resource_alias_spec.rb +143 -0
- data/spec/models/resource_aliases_list_spec.rb +53 -0
- data/spec/models/resource_binding_patch_spec.rb +41 -0
- data/spec/models/resource_binding_post_parameters_spec.rb +41 -0
- data/spec/models/resource_binding_post_spec.rb +65 -0
- data/spec/models/resource_binding_spec.rb +137 -0
- data/spec/models/resource_bindings_list_spec.rb +53 -0
- data/spec/models/resource_instance_patch_spec.rb +59 -0
- data/spec/models/resource_instance_post_spec.rb +77 -0
- data/spec/models/resource_instance_spec.rb +191 -0
- data/spec/models/resource_instances_list_spec.rb +53 -0
- data/spec/models/resource_key_patch_spec.rb +41 -0
- data/spec/models/resource_key_post_spec.rb +59 -0
- data/spec/models/resource_key_spec.rb +125 -0
- data/spec/models/resource_keys_list_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +211 -0
data/git_push.sh
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=`git remote`
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
58
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#IBM Cloud Resource Controller API
|
5
|
+
|
6
|
+
#Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 2.0
|
9
|
+
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 5.0.0-beta2
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "ibm_cloud_resource_controller/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "ibm_cloud_resource_controller"
|
20
|
+
s.version = IbmCloudResourceController::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["IBM Cloud Developers"]
|
23
|
+
s.email = [""]
|
24
|
+
s.homepage = "https://openapi-generator.tech"
|
25
|
+
s.summary = "IBM Cloud Resource Controller API"
|
26
|
+
s.description = "Ruby gem for IBM Cloud Resource Controller API"
|
27
|
+
s.license = 'Apache-2.0'
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
|
32
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
33
|
+
|
34
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
35
|
+
s.test_files = `find spec/*`.split("\n")
|
36
|
+
s.executables = []
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
=begin
|
2
|
+
#IBM Cloud Resource Controller API
|
3
|
+
|
4
|
+
#Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'ibm_cloud_resource_controller/api_client'
|
15
|
+
require 'ibm_cloud_resource_controller/api_error'
|
16
|
+
require 'ibm_cloud_resource_controller/version'
|
17
|
+
require 'ibm_cloud_resource_controller/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'ibm_cloud_resource_controller/models/credentials'
|
21
|
+
require 'ibm_cloud_resource_controller/models/error_report'
|
22
|
+
require 'ibm_cloud_resource_controller/models/plan_history_item'
|
23
|
+
require 'ibm_cloud_resource_controller/models/reclamation'
|
24
|
+
require 'ibm_cloud_resource_controller/models/reclamation_actions_post'
|
25
|
+
require 'ibm_cloud_resource_controller/models/reclamations_list'
|
26
|
+
require 'ibm_cloud_resource_controller/models/resource_alias'
|
27
|
+
require 'ibm_cloud_resource_controller/models/resource_alias_patch'
|
28
|
+
require 'ibm_cloud_resource_controller/models/resource_alias_post'
|
29
|
+
require 'ibm_cloud_resource_controller/models/resource_aliases_list'
|
30
|
+
require 'ibm_cloud_resource_controller/models/resource_binding'
|
31
|
+
require 'ibm_cloud_resource_controller/models/resource_binding_patch'
|
32
|
+
require 'ibm_cloud_resource_controller/models/resource_binding_post'
|
33
|
+
require 'ibm_cloud_resource_controller/models/resource_binding_post_parameters'
|
34
|
+
require 'ibm_cloud_resource_controller/models/resource_bindings_list'
|
35
|
+
require 'ibm_cloud_resource_controller/models/resource_instance'
|
36
|
+
require 'ibm_cloud_resource_controller/models/resource_instance_patch'
|
37
|
+
require 'ibm_cloud_resource_controller/models/resource_instance_post'
|
38
|
+
require 'ibm_cloud_resource_controller/models/resource_instances_list'
|
39
|
+
require 'ibm_cloud_resource_controller/models/resource_key'
|
40
|
+
require 'ibm_cloud_resource_controller/models/resource_key_patch'
|
41
|
+
require 'ibm_cloud_resource_controller/models/resource_key_post'
|
42
|
+
require 'ibm_cloud_resource_controller/models/resource_keys_list'
|
43
|
+
|
44
|
+
# APIs
|
45
|
+
require 'ibm_cloud_resource_controller/api/resource_aliases_api'
|
46
|
+
require 'ibm_cloud_resource_controller/api/resource_bindings_api'
|
47
|
+
require 'ibm_cloud_resource_controller/api/resource_instances_api'
|
48
|
+
require 'ibm_cloud_resource_controller/api/resource_keys_api'
|
49
|
+
require 'ibm_cloud_resource_controller/api/resource_reclamations_api'
|
50
|
+
|
51
|
+
module IbmCloudResourceController
|
52
|
+
class << self
|
53
|
+
# Customize default settings for the SDK using block.
|
54
|
+
# IbmCloudResourceController.configure do |config|
|
55
|
+
# config.username = "xxx"
|
56
|
+
# config.password = "xxx"
|
57
|
+
# end
|
58
|
+
# If no block given, return the default Configuration object.
|
59
|
+
def configure
|
60
|
+
if block_given?
|
61
|
+
yield(Configuration.default)
|
62
|
+
else
|
63
|
+
Configuration.default
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,363 @@
|
|
1
|
+
=begin
|
2
|
+
#IBM Cloud Resource Controller API
|
3
|
+
|
4
|
+
#Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module IbmCloudResourceController
|
16
|
+
class ResourceAliasesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create a new resource alias
|
23
|
+
# Alias a resource instance into a targeted environment's (name)space.
|
24
|
+
# @param resource_alias_post [ResourceAliasPost]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [ResourceAlias]
|
27
|
+
def create_resource_alias(resource_alias_post, opts = {})
|
28
|
+
data, _status_code, _headers = create_resource_alias_with_http_info(resource_alias_post, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create a new resource alias
|
33
|
+
# Alias a resource instance into a targeted environment's (name)space.
|
34
|
+
# @param resource_alias_post [ResourceAliasPost]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(ResourceAlias, Integer, Hash)>] ResourceAlias data, response status code and response headers
|
37
|
+
def create_resource_alias_with_http_info(resource_alias_post, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ResourceAliasesApi.create_resource_alias ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'resource_alias_post' is set
|
42
|
+
if @api_client.config.client_side_validation && resource_alias_post.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'resource_alias_post' when calling ResourceAliasesApi.create_resource_alias"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v2/resource_aliases'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = opts[:form_params] || {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = opts[:body] || @api_client.object_to_http_body(resource_alias_post)
|
63
|
+
|
64
|
+
# return_type
|
65
|
+
return_type = opts[:return_type] || 'ResourceAlias'
|
66
|
+
|
67
|
+
# auth_names
|
68
|
+
auth_names = opts[:auth_names] || ['IAM']
|
69
|
+
|
70
|
+
new_options = opts.merge(
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: ResourceAliasesApi#create_resource_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
|
86
|
+
# Delete a resource alias
|
87
|
+
# Delete a resource alias by ID.
|
88
|
+
# @param id [String] The short or long ID of the alias.
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [nil]
|
91
|
+
def delete_resource_alias(id, opts = {})
|
92
|
+
delete_resource_alias_with_http_info(id, opts)
|
93
|
+
nil
|
94
|
+
end
|
95
|
+
|
96
|
+
# Delete a resource alias
|
97
|
+
# Delete a resource alias by ID.
|
98
|
+
# @param id [String] The short or long ID of the alias.
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
101
|
+
def delete_resource_alias_with_http_info(id, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: ResourceAliasesApi.delete_resource_alias ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'id' is set
|
106
|
+
if @api_client.config.client_side_validation && id.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourceAliasesApi.delete_resource_alias"
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/v2/resource_aliases/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = opts[:header_params] || {}
|
117
|
+
# HTTP header 'Accept' (if needed)
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
119
|
+
|
120
|
+
# form parameters
|
121
|
+
form_params = opts[:form_params] || {}
|
122
|
+
|
123
|
+
# http body (model)
|
124
|
+
post_body = opts[:body]
|
125
|
+
|
126
|
+
# return_type
|
127
|
+
return_type = opts[:return_type]
|
128
|
+
|
129
|
+
# auth_names
|
130
|
+
auth_names = opts[:auth_names] || ['IAM']
|
131
|
+
|
132
|
+
new_options = opts.merge(
|
133
|
+
:header_params => header_params,
|
134
|
+
:query_params => query_params,
|
135
|
+
:form_params => form_params,
|
136
|
+
:body => post_body,
|
137
|
+
:auth_names => auth_names,
|
138
|
+
:return_type => return_type
|
139
|
+
)
|
140
|
+
|
141
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
142
|
+
if @api_client.config.debugging
|
143
|
+
@api_client.config.logger.debug "API called: ResourceAliasesApi#delete_resource_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
144
|
+
end
|
145
|
+
return data, status_code, headers
|
146
|
+
end
|
147
|
+
|
148
|
+
# Get a resource alias
|
149
|
+
# Retrieve a resource alias by ID.
|
150
|
+
# @param id [String] The short or long ID of the alias.
|
151
|
+
# @param [Hash] opts the optional parameters
|
152
|
+
# @return [ResourceAlias]
|
153
|
+
def get_resource_alias(id, opts = {})
|
154
|
+
data, _status_code, _headers = get_resource_alias_with_http_info(id, opts)
|
155
|
+
data
|
156
|
+
end
|
157
|
+
|
158
|
+
# Get a resource alias
|
159
|
+
# Retrieve a resource alias by ID.
|
160
|
+
# @param id [String] The short or long ID of the alias.
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @return [Array<(ResourceAlias, Integer, Hash)>] ResourceAlias data, response status code and response headers
|
163
|
+
def get_resource_alias_with_http_info(id, opts = {})
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug 'Calling API: ResourceAliasesApi.get_resource_alias ...'
|
166
|
+
end
|
167
|
+
# verify the required parameter 'id' is set
|
168
|
+
if @api_client.config.client_side_validation && id.nil?
|
169
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourceAliasesApi.get_resource_alias"
|
170
|
+
end
|
171
|
+
# resource path
|
172
|
+
local_var_path = '/v2/resource_aliases/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
173
|
+
|
174
|
+
# query parameters
|
175
|
+
query_params = opts[:query_params] || {}
|
176
|
+
|
177
|
+
# header parameters
|
178
|
+
header_params = opts[:header_params] || {}
|
179
|
+
# HTTP header 'Accept' (if needed)
|
180
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
181
|
+
|
182
|
+
# form parameters
|
183
|
+
form_params = opts[:form_params] || {}
|
184
|
+
|
185
|
+
# http body (model)
|
186
|
+
post_body = opts[:body]
|
187
|
+
|
188
|
+
# return_type
|
189
|
+
return_type = opts[:return_type] || 'ResourceAlias'
|
190
|
+
|
191
|
+
# auth_names
|
192
|
+
auth_names = opts[:auth_names] || ['IAM']
|
193
|
+
|
194
|
+
new_options = opts.merge(
|
195
|
+
:header_params => header_params,
|
196
|
+
:query_params => query_params,
|
197
|
+
:form_params => form_params,
|
198
|
+
:body => post_body,
|
199
|
+
:auth_names => auth_names,
|
200
|
+
:return_type => return_type
|
201
|
+
)
|
202
|
+
|
203
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
204
|
+
if @api_client.config.debugging
|
205
|
+
@api_client.config.logger.debug "API called: ResourceAliasesApi#get_resource_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
206
|
+
end
|
207
|
+
return data, status_code, headers
|
208
|
+
end
|
209
|
+
|
210
|
+
# Get a list of all resource aliases
|
211
|
+
# Get a list of all resource aliases.
|
212
|
+
# @param [Hash] opts the optional parameters
|
213
|
+
# @option opts [String] :guid Short ID of the alias.
|
214
|
+
# @option opts [String] :name The human-readable name of the alias.
|
215
|
+
# @option opts [String] :resource_instance_id Resource instance short ID.
|
216
|
+
# @option opts [String] :region_instance_id Short ID of the instance in a specific targeted environment. For example, `service_instance_id` in a given IBM Cloud environment.
|
217
|
+
# @option opts [String] :resource_id The unique ID of the offering (service name). This value is provided by and stored in the global catalog.
|
218
|
+
# @option opts [String] :resource_group_id Short ID of Resource group.
|
219
|
+
# @option opts [String] :limit Limit on how many items should be returned.
|
220
|
+
# @option opts [String] :updated_from Start date inclusive filter.
|
221
|
+
# @option opts [String] :updated_to End date inclusive filter.
|
222
|
+
# @return [ResourceAliasesList]
|
223
|
+
def list_resource_aliases(opts = {})
|
224
|
+
data, _status_code, _headers = list_resource_aliases_with_http_info(opts)
|
225
|
+
data
|
226
|
+
end
|
227
|
+
|
228
|
+
# Get a list of all resource aliases
|
229
|
+
# Get a list of all resource aliases.
|
230
|
+
# @param [Hash] opts the optional parameters
|
231
|
+
# @option opts [String] :guid Short ID of the alias.
|
232
|
+
# @option opts [String] :name The human-readable name of the alias.
|
233
|
+
# @option opts [String] :resource_instance_id Resource instance short ID.
|
234
|
+
# @option opts [String] :region_instance_id Short ID of the instance in a specific targeted environment. For example, `service_instance_id` in a given IBM Cloud environment.
|
235
|
+
# @option opts [String] :resource_id The unique ID of the offering (service name). This value is provided by and stored in the global catalog.
|
236
|
+
# @option opts [String] :resource_group_id Short ID of Resource group.
|
237
|
+
# @option opts [String] :limit Limit on how many items should be returned.
|
238
|
+
# @option opts [String] :updated_from Start date inclusive filter.
|
239
|
+
# @option opts [String] :updated_to End date inclusive filter.
|
240
|
+
# @return [Array<(ResourceAliasesList, Integer, Hash)>] ResourceAliasesList data, response status code and response headers
|
241
|
+
def list_resource_aliases_with_http_info(opts = {})
|
242
|
+
if @api_client.config.debugging
|
243
|
+
@api_client.config.logger.debug 'Calling API: ResourceAliasesApi.list_resource_aliases ...'
|
244
|
+
end
|
245
|
+
# resource path
|
246
|
+
local_var_path = '/v2/resource_aliases'
|
247
|
+
|
248
|
+
# query parameters
|
249
|
+
query_params = opts[:query_params] || {}
|
250
|
+
query_params[:'guid'] = opts[:'guid'] if !opts[:'guid'].nil?
|
251
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
252
|
+
query_params[:'resource_instance_id'] = opts[:'resource_instance_id'] if !opts[:'resource_instance_id'].nil?
|
253
|
+
query_params[:'region_instance_id'] = opts[:'region_instance_id'] if !opts[:'region_instance_id'].nil?
|
254
|
+
query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].nil?
|
255
|
+
query_params[:'resource_group_id'] = opts[:'resource_group_id'] if !opts[:'resource_group_id'].nil?
|
256
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
257
|
+
query_params[:'updated_from'] = opts[:'updated_from'] if !opts[:'updated_from'].nil?
|
258
|
+
query_params[:'updated_to'] = opts[:'updated_to'] if !opts[:'updated_to'].nil?
|
259
|
+
|
260
|
+
# header parameters
|
261
|
+
header_params = opts[:header_params] || {}
|
262
|
+
# HTTP header 'Accept' (if needed)
|
263
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
264
|
+
|
265
|
+
# form parameters
|
266
|
+
form_params = opts[:form_params] || {}
|
267
|
+
|
268
|
+
# http body (model)
|
269
|
+
post_body = opts[:body]
|
270
|
+
|
271
|
+
# return_type
|
272
|
+
return_type = opts[:return_type] || 'ResourceAliasesList'
|
273
|
+
|
274
|
+
# auth_names
|
275
|
+
auth_names = opts[:auth_names] || ['IAM']
|
276
|
+
|
277
|
+
new_options = opts.merge(
|
278
|
+
:header_params => header_params,
|
279
|
+
:query_params => query_params,
|
280
|
+
:form_params => form_params,
|
281
|
+
:body => post_body,
|
282
|
+
:auth_names => auth_names,
|
283
|
+
:return_type => return_type
|
284
|
+
)
|
285
|
+
|
286
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
287
|
+
if @api_client.config.debugging
|
288
|
+
@api_client.config.logger.debug "API called: ResourceAliasesApi#list_resource_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
289
|
+
end
|
290
|
+
return data, status_code, headers
|
291
|
+
end
|
292
|
+
|
293
|
+
# Update a resource alias
|
294
|
+
# Update a resource alias by ID.
|
295
|
+
# @param id [String] The short or long ID of the alias.
|
296
|
+
# @param resource_alias_patch [ResourceAliasPatch]
|
297
|
+
# @param [Hash] opts the optional parameters
|
298
|
+
# @return [ResourceAlias]
|
299
|
+
def update_resource_alias(id, resource_alias_patch, opts = {})
|
300
|
+
data, _status_code, _headers = update_resource_alias_with_http_info(id, resource_alias_patch, opts)
|
301
|
+
data
|
302
|
+
end
|
303
|
+
|
304
|
+
# Update a resource alias
|
305
|
+
# Update a resource alias by ID.
|
306
|
+
# @param id [String] The short or long ID of the alias.
|
307
|
+
# @param resource_alias_patch [ResourceAliasPatch]
|
308
|
+
# @param [Hash] opts the optional parameters
|
309
|
+
# @return [Array<(ResourceAlias, Integer, Hash)>] ResourceAlias data, response status code and response headers
|
310
|
+
def update_resource_alias_with_http_info(id, resource_alias_patch, opts = {})
|
311
|
+
if @api_client.config.debugging
|
312
|
+
@api_client.config.logger.debug 'Calling API: ResourceAliasesApi.update_resource_alias ...'
|
313
|
+
end
|
314
|
+
# verify the required parameter 'id' is set
|
315
|
+
if @api_client.config.client_side_validation && id.nil?
|
316
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourceAliasesApi.update_resource_alias"
|
317
|
+
end
|
318
|
+
# verify the required parameter 'resource_alias_patch' is set
|
319
|
+
if @api_client.config.client_side_validation && resource_alias_patch.nil?
|
320
|
+
fail ArgumentError, "Missing the required parameter 'resource_alias_patch' when calling ResourceAliasesApi.update_resource_alias"
|
321
|
+
end
|
322
|
+
# resource path
|
323
|
+
local_var_path = '/v2/resource_aliases/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
324
|
+
|
325
|
+
# query parameters
|
326
|
+
query_params = opts[:query_params] || {}
|
327
|
+
|
328
|
+
# header parameters
|
329
|
+
header_params = opts[:header_params] || {}
|
330
|
+
# HTTP header 'Accept' (if needed)
|
331
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
332
|
+
# HTTP header 'Content-Type'
|
333
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
334
|
+
|
335
|
+
# form parameters
|
336
|
+
form_params = opts[:form_params] || {}
|
337
|
+
|
338
|
+
# http body (model)
|
339
|
+
post_body = opts[:body] || @api_client.object_to_http_body(resource_alias_patch)
|
340
|
+
|
341
|
+
# return_type
|
342
|
+
return_type = opts[:return_type] || 'ResourceAlias'
|
343
|
+
|
344
|
+
# auth_names
|
345
|
+
auth_names = opts[:auth_names] || ['IAM']
|
346
|
+
|
347
|
+
new_options = opts.merge(
|
348
|
+
:header_params => header_params,
|
349
|
+
:query_params => query_params,
|
350
|
+
:form_params => form_params,
|
351
|
+
:body => post_body,
|
352
|
+
:auth_names => auth_names,
|
353
|
+
:return_type => return_type
|
354
|
+
)
|
355
|
+
|
356
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
357
|
+
if @api_client.config.debugging
|
358
|
+
@api_client.config.logger.debug "API called: ResourceAliasesApi#update_resource_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
359
|
+
end
|
360
|
+
return data, status_code, headers
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|