harbor2_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +186 -0
- data/Rakefile +8 -0
- data/docs/AdditionLink.md +9 -0
- data/docs/AdditionLinks.md +7 -0
- data/docs/Annotations.md +7 -0
- data/docs/Artifact.md +25 -0
- data/docs/ArtifactApi.md +694 -0
- data/docs/AuditLog.md +13 -0
- data/docs/AuditlogApi.md +69 -0
- data/docs/CVEAllowlist.md +13 -0
- data/docs/CVEAllowlistItem.md +8 -0
- data/docs/Error.md +9 -0
- data/docs/Errors.md +8 -0
- data/docs/Execution.md +17 -0
- data/docs/ExtraAttrs.md +7 -0
- data/docs/Icon.md +9 -0
- data/docs/IconApi.md +66 -0
- data/docs/Instance.md +19 -0
- data/docs/Label.md +15 -0
- data/docs/Metadata.md +13 -0
- data/docs/Metrics.md +14 -0
- data/docs/NativeReportSummary.md +15 -0
- data/docs/Platform.md +12 -0
- data/docs/PreheatApi.md +1176 -0
- data/docs/PreheatPolicy.md +18 -0
- data/docs/Project.md +22 -0
- data/docs/ProjectApi.md +542 -0
- data/docs/ProjectDeletable.md +9 -0
- data/docs/ProjectMetadata.md +14 -0
- data/docs/ProjectReq.md +13 -0
- data/docs/ProjectSummary.md +16 -0
- data/docs/ProjectSummaryQuota.md +9 -0
- data/docs/ProviderUnderProject.md +11 -0
- data/docs/Reference.md +13 -0
- data/docs/Registry.md +17 -0
- data/docs/RegistryCredential.md +10 -0
- data/docs/Repository.md +15 -0
- data/docs/RepositoryApi.md +256 -0
- data/docs/ResourceList.md +7 -0
- data/docs/ScanApi.md +138 -0
- data/docs/ScanOverview.md +7 -0
- data/docs/Tag.md +15 -0
- data/docs/Task.md +17 -0
- data/docs/VulnerabilitySummary.md +10 -0
- data/git_push.sh +55 -0
- data/harbor2_client.gemspec +46 -0
- data/lib/harbor2_client.rb +81 -0
- data/lib/harbor2_client/api/artifact_api.rb +848 -0
- data/lib/harbor2_client/api/auditlog_api.rb +91 -0
- data/lib/harbor2_client/api/icon_api.rb +84 -0
- data/lib/harbor2_client/api/preheat_api.rb +1327 -0
- data/lib/harbor2_client/api/project_api.rb +601 -0
- data/lib/harbor2_client/api/repository_api.rb +302 -0
- data/lib/harbor2_client/api/scan_api.rb +174 -0
- data/lib/harbor2_client/api_client.rb +391 -0
- data/lib/harbor2_client/api_error.rb +38 -0
- data/lib/harbor2_client/configuration.rb +209 -0
- data/lib/harbor2_client/models/addition_link.rb +195 -0
- data/lib/harbor2_client/models/addition_links.rb +175 -0
- data/lib/harbor2_client/models/annotations.rb +175 -0
- data/lib/harbor2_client/models/artifact.rb +355 -0
- data/lib/harbor2_client/models/audit_log.rb +235 -0
- data/lib/harbor2_client/models/cve_allowlist.rb +237 -0
- data/lib/harbor2_client/models/cve_allowlist_item.rb +186 -0
- data/lib/harbor2_client/models/error.rb +196 -0
- data/lib/harbor2_client/models/errors.rb +187 -0
- data/lib/harbor2_client/models/execution.rb +273 -0
- data/lib/harbor2_client/models/extra_attrs.rb +175 -0
- data/lib/harbor2_client/models/icon.rb +195 -0
- data/lib/harbor2_client/models/instance.rb +297 -0
- data/lib/harbor2_client/models/label.rb +255 -0
- data/lib/harbor2_client/models/metadata.rb +237 -0
- data/lib/harbor2_client/models/metrics.rb +245 -0
- data/lib/harbor2_client/models/native_report_summary.rb +255 -0
- data/lib/harbor2_client/models/platform.rb +227 -0
- data/lib/harbor2_client/models/preheat_policy.rb +285 -0
- data/lib/harbor2_client/models/project.rb +327 -0
- data/lib/harbor2_client/models/project_deletable.rb +195 -0
- data/lib/harbor2_client/models/project_metadata.rb +245 -0
- data/lib/harbor2_client/models/project_req.rb +235 -0
- data/lib/harbor2_client/models/project_summary.rb +263 -0
- data/lib/harbor2_client/models/project_summary_quota.rb +195 -0
- data/lib/harbor2_client/models/provider_under_project.rb +211 -0
- data/lib/harbor2_client/models/reference.rb +235 -0
- data/lib/harbor2_client/models/registry.rb +274 -0
- data/lib/harbor2_client/models/registry_credential.rb +205 -0
- data/lib/harbor2_client/models/repository.rb +255 -0
- data/lib/harbor2_client/models/resource_list.rb +175 -0
- data/lib/harbor2_client/models/scan_overview.rb +176 -0
- data/lib/harbor2_client/models/tag.rb +255 -0
- data/lib/harbor2_client/models/task.rb +274 -0
- data/lib/harbor2_client/models/vulnerability_summary.rb +208 -0
- data/lib/harbor2_client/version.rb +15 -0
- data/spec/api/artifact_api_spec.rb +209 -0
- data/spec/api/auditlog_api_spec.rb +50 -0
- data/spec/api/icon_api_spec.rb +48 -0
- data/spec/api/preheat_api_spec.rb +311 -0
- data/spec/api/project_api_spec.rb +160 -0
- data/spec/api/repository_api_spec.rb +94 -0
- data/spec/api/scan_api_spec.rb +66 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/addition_link_spec.rb +47 -0
- data/spec/models/addition_links_spec.rb +35 -0
- data/spec/models/annotations_spec.rb +35 -0
- data/spec/models/artifact_spec.rb +143 -0
- data/spec/models/audit_log_spec.rb +71 -0
- data/spec/models/cve_allowlist_item_spec.rb +41 -0
- data/spec/models/cve_allowlist_spec.rb +71 -0
- data/spec/models/error_spec.rb +47 -0
- data/spec/models/errors_spec.rb +41 -0
- data/spec/models/execution_spec.rb +95 -0
- data/spec/models/extra_attrs_spec.rb +35 -0
- data/spec/models/icon_spec.rb +47 -0
- data/spec/models/instance_spec.rb +107 -0
- data/spec/models/label_spec.rb +83 -0
- data/spec/models/metadata_spec.rb +71 -0
- data/spec/models/metrics_spec.rb +77 -0
- data/spec/models/native_report_summary_spec.rb +83 -0
- data/spec/models/platform_spec.rb +65 -0
- data/spec/models/preheat_policy_spec.rb +101 -0
- data/spec/models/project_deletable_spec.rb +47 -0
- data/spec/models/project_metadata_spec.rb +77 -0
- data/spec/models/project_req_spec.rb +71 -0
- data/spec/models/project_spec.rb +125 -0
- data/spec/models/project_summary_quota_spec.rb +47 -0
- data/spec/models/project_summary_spec.rb +89 -0
- data/spec/models/provider_under_project_spec.rb +59 -0
- data/spec/models/reference_spec.rb +71 -0
- data/spec/models/registry_credential_spec.rb +53 -0
- data/spec/models/registry_spec.rb +95 -0
- data/spec/models/repository_spec.rb +83 -0
- data/spec/models/resource_list_spec.rb +35 -0
- data/spec/models/scan_overview_spec.rb +35 -0
- data/spec/models/tag_spec.rb +83 -0
- data/spec/models/task_spec.rb +95 -0
- data/spec/models/vulnerability_summary_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +428 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
=begin
|
2
|
+
#Harbor API
|
3
|
+
|
4
|
+
#These APIs provide services for manipulating Harbor project.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.17
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Harbor2Client
|
16
|
+
class AuditlogApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get recent logs of the projects which the user is a member of
|
23
|
+
# This endpoint let user see the recent operation logs of the projects which he is member of
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
26
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
27
|
+
# @option opts [Integer] :page The page number (default to 1)
|
28
|
+
# @option opts [Integer] :page_size The size of per page (default to 10)
|
29
|
+
# @return [Array<AuditLog>]
|
30
|
+
def list_audit_logs(opts = {})
|
31
|
+
data, _status_code, _headers = list_audit_logs_with_http_info(opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Get recent logs of the projects which the user is a member of
|
36
|
+
# This endpoint let user see the recent operation logs of the projects which he is member of
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
39
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
40
|
+
# @option opts [Integer] :page The page number
|
41
|
+
# @option opts [Integer] :page_size The size of per page
|
42
|
+
# @return [Array<(Array<AuditLog>, Fixnum, Hash)>] Array<AuditLog> data, response status code and response headers
|
43
|
+
def list_audit_logs_with_http_info(opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: AuditlogApi.list_audit_logs ...'
|
46
|
+
end
|
47
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
48
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling AuditlogApi.list_audit_logs, the character length must be great than or equal to 1.'
|
49
|
+
end
|
50
|
+
|
51
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
52
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AuditlogApi.list_audit_logs, must be smaller than or equal to 100.'
|
53
|
+
end
|
54
|
+
|
55
|
+
# resource path
|
56
|
+
local_var_path = '/audit-logs'
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = {}
|
60
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
61
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
62
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
63
|
+
|
64
|
+
# header parameters
|
65
|
+
header_params = {}
|
66
|
+
# HTTP header 'Accept' (if needed)
|
67
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
68
|
+
# HTTP header 'Content-Type'
|
69
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
70
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
71
|
+
|
72
|
+
# form parameters
|
73
|
+
form_params = {}
|
74
|
+
|
75
|
+
# http body (model)
|
76
|
+
post_body = nil
|
77
|
+
auth_names = ['basic']
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
79
|
+
:header_params => header_params,
|
80
|
+
:query_params => query_params,
|
81
|
+
:form_params => form_params,
|
82
|
+
:body => post_body,
|
83
|
+
:auth_names => auth_names,
|
84
|
+
:return_type => 'Array<AuditLog>')
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: AuditlogApi#list_audit_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
=begin
|
2
|
+
#Harbor API
|
3
|
+
|
4
|
+
#These APIs provide services for manipulating Harbor project.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.17
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Harbor2Client
|
16
|
+
class IconApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get artifact icon
|
23
|
+
# Get the artifact icon with the specified digest. As the original icon image is resized and encoded before returning, the parameter \"digest\" in the path doesn't match the hash of the returned content
|
24
|
+
# @param digest The digest of the resource
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
27
|
+
# @return [Icon]
|
28
|
+
def get_icon(digest, opts = {})
|
29
|
+
data, _status_code, _headers = get_icon_with_http_info(digest, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Get artifact icon
|
34
|
+
# Get the artifact icon with the specified digest. As the original icon image is resized and encoded before returning, the parameter \"digest\" in the path doesn't match the hash of the returned content
|
35
|
+
# @param digest The digest of the resource
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
38
|
+
# @return [Array<(Icon, Fixnum, Hash)>] Icon data, response status code and response headers
|
39
|
+
def get_icon_with_http_info(digest, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: IconApi.get_icon ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'digest' is set
|
44
|
+
if @api_client.config.client_side_validation && digest.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'digest' when calling IconApi.get_icon"
|
46
|
+
end
|
47
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
48
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling IconApi.get_icon, the character length must be great than or equal to 1.'
|
49
|
+
end
|
50
|
+
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/icons/{digest}'.sub('{' + 'digest' + '}', digest.to_s)
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
63
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = {}
|
67
|
+
|
68
|
+
# http body (model)
|
69
|
+
post_body = nil
|
70
|
+
auth_names = ['basic']
|
71
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
72
|
+
:header_params => header_params,
|
73
|
+
:query_params => query_params,
|
74
|
+
:form_params => form_params,
|
75
|
+
:body => post_body,
|
76
|
+
:auth_names => auth_names,
|
77
|
+
:return_type => 'Icon')
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: IconApi#get_icon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,1327 @@
|
|
1
|
+
=begin
|
2
|
+
#Harbor API
|
3
|
+
|
4
|
+
#These APIs provide services for manipulating Harbor project.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.17
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Harbor2Client
|
16
|
+
class PreheatApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create p2p provider instances
|
23
|
+
# Create p2p provider instances
|
24
|
+
# @param instance The JSON object of instance.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
27
|
+
# @return [nil]
|
28
|
+
def create_instance(instance, opts = {})
|
29
|
+
create_instance_with_http_info(instance, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# Create p2p provider instances
|
34
|
+
# Create p2p provider instances
|
35
|
+
# @param instance The JSON object of instance.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
38
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
39
|
+
def create_instance_with_http_info(instance, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.create_instance ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'instance' is set
|
44
|
+
if @api_client.config.client_side_validation && instance.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'instance' when calling PreheatApi.create_instance"
|
46
|
+
end
|
47
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
48
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.create_instance, the character length must be great than or equal to 1.'
|
49
|
+
end
|
50
|
+
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/p2p/preheat/instances'
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
63
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = {}
|
67
|
+
|
68
|
+
# http body (model)
|
69
|
+
post_body = @api_client.object_to_http_body(instance)
|
70
|
+
auth_names = ['basic']
|
71
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
72
|
+
:header_params => header_params,
|
73
|
+
:query_params => query_params,
|
74
|
+
:form_params => form_params,
|
75
|
+
:body => post_body,
|
76
|
+
:auth_names => auth_names)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: PreheatApi#create_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
# Create a preheat policy under a project
|
83
|
+
# Create a preheat policy under a project
|
84
|
+
# @param project_name The name of the project
|
85
|
+
# @param policy The policy schema info
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
88
|
+
# @return [nil]
|
89
|
+
def create_policy(project_name, policy, opts = {})
|
90
|
+
create_policy_with_http_info(project_name, policy, opts)
|
91
|
+
nil
|
92
|
+
end
|
93
|
+
|
94
|
+
# Create a preheat policy under a project
|
95
|
+
# Create a preheat policy under a project
|
96
|
+
# @param project_name The name of the project
|
97
|
+
# @param policy The policy schema info
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
100
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
101
|
+
def create_policy_with_http_info(project_name, policy, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.create_policy ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'project_name' is set
|
106
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.create_policy"
|
108
|
+
end
|
109
|
+
# verify the required parameter 'policy' is set
|
110
|
+
if @api_client.config.client_side_validation && policy.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'policy' when calling PreheatApi.create_policy"
|
112
|
+
end
|
113
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
114
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.create_policy, the character length must be great than or equal to 1.'
|
115
|
+
end
|
116
|
+
|
117
|
+
# resource path
|
118
|
+
local_var_path = '/projects/{project_name}/preheat/policies'.sub('{' + 'project_name' + '}', project_name.to_s)
|
119
|
+
|
120
|
+
# query parameters
|
121
|
+
query_params = {}
|
122
|
+
|
123
|
+
# header parameters
|
124
|
+
header_params = {}
|
125
|
+
# HTTP header 'Accept' (if needed)
|
126
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
127
|
+
# HTTP header 'Content-Type'
|
128
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
129
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
130
|
+
|
131
|
+
# form parameters
|
132
|
+
form_params = {}
|
133
|
+
|
134
|
+
# http body (model)
|
135
|
+
post_body = @api_client.object_to_http_body(policy)
|
136
|
+
auth_names = ['basic']
|
137
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
138
|
+
:header_params => header_params,
|
139
|
+
:query_params => query_params,
|
140
|
+
:form_params => form_params,
|
141
|
+
:body => post_body,
|
142
|
+
:auth_names => auth_names)
|
143
|
+
if @api_client.config.debugging
|
144
|
+
@api_client.config.logger.debug "API called: PreheatApi#create_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
145
|
+
end
|
146
|
+
return data, status_code, headers
|
147
|
+
end
|
148
|
+
# Delete the specified P2P provider instance
|
149
|
+
# Delete the specified P2P provider instance
|
150
|
+
# @param preheat_instance_name Instance Name
|
151
|
+
# @param [Hash] opts the optional parameters
|
152
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
153
|
+
# @return [nil]
|
154
|
+
def delete_instance(preheat_instance_name, opts = {})
|
155
|
+
delete_instance_with_http_info(preheat_instance_name, opts)
|
156
|
+
nil
|
157
|
+
end
|
158
|
+
|
159
|
+
# Delete the specified P2P provider instance
|
160
|
+
# Delete the specified P2P provider instance
|
161
|
+
# @param preheat_instance_name Instance Name
|
162
|
+
# @param [Hash] opts the optional parameters
|
163
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
164
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
165
|
+
def delete_instance_with_http_info(preheat_instance_name, opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.delete_instance ...'
|
168
|
+
end
|
169
|
+
# verify the required parameter 'preheat_instance_name' is set
|
170
|
+
if @api_client.config.client_side_validation && preheat_instance_name.nil?
|
171
|
+
fail ArgumentError, "Missing the required parameter 'preheat_instance_name' when calling PreheatApi.delete_instance"
|
172
|
+
end
|
173
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
174
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.delete_instance, the character length must be great than or equal to 1.'
|
175
|
+
end
|
176
|
+
|
177
|
+
# resource path
|
178
|
+
local_var_path = '/p2p/preheat/instances/{preheat_instance_name}'.sub('{' + 'preheat_instance_name' + '}', preheat_instance_name.to_s)
|
179
|
+
|
180
|
+
# query parameters
|
181
|
+
query_params = {}
|
182
|
+
|
183
|
+
# header parameters
|
184
|
+
header_params = {}
|
185
|
+
# HTTP header 'Accept' (if needed)
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
187
|
+
# HTTP header 'Content-Type'
|
188
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
189
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
190
|
+
|
191
|
+
# form parameters
|
192
|
+
form_params = {}
|
193
|
+
|
194
|
+
# http body (model)
|
195
|
+
post_body = nil
|
196
|
+
auth_names = ['basic']
|
197
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
198
|
+
:header_params => header_params,
|
199
|
+
:query_params => query_params,
|
200
|
+
:form_params => form_params,
|
201
|
+
:body => post_body,
|
202
|
+
:auth_names => auth_names)
|
203
|
+
if @api_client.config.debugging
|
204
|
+
@api_client.config.logger.debug "API called: PreheatApi#delete_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
205
|
+
end
|
206
|
+
return data, status_code, headers
|
207
|
+
end
|
208
|
+
# Delete a preheat policy
|
209
|
+
# Delete a preheat policy
|
210
|
+
# @param project_name The name of the project
|
211
|
+
# @param preheat_policy_name Preheat Policy Name
|
212
|
+
# @param [Hash] opts the optional parameters
|
213
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
214
|
+
# @return [nil]
|
215
|
+
def delete_policy(project_name, preheat_policy_name, opts = {})
|
216
|
+
delete_policy_with_http_info(project_name, preheat_policy_name, opts)
|
217
|
+
nil
|
218
|
+
end
|
219
|
+
|
220
|
+
# Delete a preheat policy
|
221
|
+
# Delete a preheat policy
|
222
|
+
# @param project_name The name of the project
|
223
|
+
# @param preheat_policy_name Preheat Policy Name
|
224
|
+
# @param [Hash] opts the optional parameters
|
225
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
226
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
227
|
+
def delete_policy_with_http_info(project_name, preheat_policy_name, opts = {})
|
228
|
+
if @api_client.config.debugging
|
229
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.delete_policy ...'
|
230
|
+
end
|
231
|
+
# verify the required parameter 'project_name' is set
|
232
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
233
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.delete_policy"
|
234
|
+
end
|
235
|
+
# verify the required parameter 'preheat_policy_name' is set
|
236
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
237
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.delete_policy"
|
238
|
+
end
|
239
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
240
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.delete_policy, the character length must be great than or equal to 1.'
|
241
|
+
end
|
242
|
+
|
243
|
+
# resource path
|
244
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)
|
245
|
+
|
246
|
+
# query parameters
|
247
|
+
query_params = {}
|
248
|
+
|
249
|
+
# header parameters
|
250
|
+
header_params = {}
|
251
|
+
# HTTP header 'Accept' (if needed)
|
252
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
253
|
+
# HTTP header 'Content-Type'
|
254
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
255
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
256
|
+
|
257
|
+
# form parameters
|
258
|
+
form_params = {}
|
259
|
+
|
260
|
+
# http body (model)
|
261
|
+
post_body = nil
|
262
|
+
auth_names = ['basic']
|
263
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
264
|
+
:header_params => header_params,
|
265
|
+
:query_params => query_params,
|
266
|
+
:form_params => form_params,
|
267
|
+
:body => post_body,
|
268
|
+
:auth_names => auth_names)
|
269
|
+
if @api_client.config.debugging
|
270
|
+
@api_client.config.logger.debug "API called: PreheatApi#delete_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
271
|
+
end
|
272
|
+
return data, status_code, headers
|
273
|
+
end
|
274
|
+
# Get a execution detail by id
|
275
|
+
# Get a execution detail by id
|
276
|
+
# @param project_name The name of the project
|
277
|
+
# @param preheat_policy_name Preheat Policy Name
|
278
|
+
# @param execution_id Execution ID
|
279
|
+
# @param [Hash] opts the optional parameters
|
280
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
281
|
+
# @return [Execution]
|
282
|
+
def get_execution(project_name, preheat_policy_name, execution_id, opts = {})
|
283
|
+
data, _status_code, _headers = get_execution_with_http_info(project_name, preheat_policy_name, execution_id, opts)
|
284
|
+
data
|
285
|
+
end
|
286
|
+
|
287
|
+
# Get a execution detail by id
|
288
|
+
# Get a execution detail by id
|
289
|
+
# @param project_name The name of the project
|
290
|
+
# @param preheat_policy_name Preheat Policy Name
|
291
|
+
# @param execution_id Execution ID
|
292
|
+
# @param [Hash] opts the optional parameters
|
293
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
294
|
+
# @return [Array<(Execution, Fixnum, Hash)>] Execution data, response status code and response headers
|
295
|
+
def get_execution_with_http_info(project_name, preheat_policy_name, execution_id, opts = {})
|
296
|
+
if @api_client.config.debugging
|
297
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.get_execution ...'
|
298
|
+
end
|
299
|
+
# verify the required parameter 'project_name' is set
|
300
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
301
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.get_execution"
|
302
|
+
end
|
303
|
+
# verify the required parameter 'preheat_policy_name' is set
|
304
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
305
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.get_execution"
|
306
|
+
end
|
307
|
+
# verify the required parameter 'execution_id' is set
|
308
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
309
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.get_execution"
|
310
|
+
end
|
311
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
312
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_execution, the character length must be great than or equal to 1.'
|
313
|
+
end
|
314
|
+
|
315
|
+
# resource path
|
316
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s)
|
317
|
+
|
318
|
+
# query parameters
|
319
|
+
query_params = {}
|
320
|
+
|
321
|
+
# header parameters
|
322
|
+
header_params = {}
|
323
|
+
# HTTP header 'Accept' (if needed)
|
324
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
325
|
+
# HTTP header 'Content-Type'
|
326
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
327
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
328
|
+
|
329
|
+
# form parameters
|
330
|
+
form_params = {}
|
331
|
+
|
332
|
+
# http body (model)
|
333
|
+
post_body = nil
|
334
|
+
auth_names = ['basic']
|
335
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
336
|
+
:header_params => header_params,
|
337
|
+
:query_params => query_params,
|
338
|
+
:form_params => form_params,
|
339
|
+
:body => post_body,
|
340
|
+
:auth_names => auth_names,
|
341
|
+
:return_type => 'Execution')
|
342
|
+
if @api_client.config.debugging
|
343
|
+
@api_client.config.logger.debug "API called: PreheatApi#get_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
344
|
+
end
|
345
|
+
return data, status_code, headers
|
346
|
+
end
|
347
|
+
# Get a P2P provider instance
|
348
|
+
# Get a P2P provider instance
|
349
|
+
# @param preheat_instance_name Instance Name
|
350
|
+
# @param [Hash] opts the optional parameters
|
351
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
352
|
+
# @return [Instance]
|
353
|
+
def get_instance(preheat_instance_name, opts = {})
|
354
|
+
data, _status_code, _headers = get_instance_with_http_info(preheat_instance_name, opts)
|
355
|
+
data
|
356
|
+
end
|
357
|
+
|
358
|
+
# Get a P2P provider instance
|
359
|
+
# Get a P2P provider instance
|
360
|
+
# @param preheat_instance_name Instance Name
|
361
|
+
# @param [Hash] opts the optional parameters
|
362
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
363
|
+
# @return [Array<(Instance, Fixnum, Hash)>] Instance data, response status code and response headers
|
364
|
+
def get_instance_with_http_info(preheat_instance_name, opts = {})
|
365
|
+
if @api_client.config.debugging
|
366
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.get_instance ...'
|
367
|
+
end
|
368
|
+
# verify the required parameter 'preheat_instance_name' is set
|
369
|
+
if @api_client.config.client_side_validation && preheat_instance_name.nil?
|
370
|
+
fail ArgumentError, "Missing the required parameter 'preheat_instance_name' when calling PreheatApi.get_instance"
|
371
|
+
end
|
372
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
373
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_instance, the character length must be great than or equal to 1.'
|
374
|
+
end
|
375
|
+
|
376
|
+
# resource path
|
377
|
+
local_var_path = '/p2p/preheat/instances/{preheat_instance_name}'.sub('{' + 'preheat_instance_name' + '}', preheat_instance_name.to_s)
|
378
|
+
|
379
|
+
# query parameters
|
380
|
+
query_params = {}
|
381
|
+
|
382
|
+
# header parameters
|
383
|
+
header_params = {}
|
384
|
+
# HTTP header 'Accept' (if needed)
|
385
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
386
|
+
# HTTP header 'Content-Type'
|
387
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
388
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
389
|
+
|
390
|
+
# form parameters
|
391
|
+
form_params = {}
|
392
|
+
|
393
|
+
# http body (model)
|
394
|
+
post_body = nil
|
395
|
+
auth_names = ['basic']
|
396
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
397
|
+
:header_params => header_params,
|
398
|
+
:query_params => query_params,
|
399
|
+
:form_params => form_params,
|
400
|
+
:body => post_body,
|
401
|
+
:auth_names => auth_names,
|
402
|
+
:return_type => 'Instance')
|
403
|
+
if @api_client.config.debugging
|
404
|
+
@api_client.config.logger.debug "API called: PreheatApi#get_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
405
|
+
end
|
406
|
+
return data, status_code, headers
|
407
|
+
end
|
408
|
+
# Get a preheat policy
|
409
|
+
# Get a preheat policy
|
410
|
+
# @param project_name The name of the project
|
411
|
+
# @param preheat_policy_name Preheat Policy Name
|
412
|
+
# @param [Hash] opts the optional parameters
|
413
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
414
|
+
# @return [PreheatPolicy]
|
415
|
+
def get_policy(project_name, preheat_policy_name, opts = {})
|
416
|
+
data, _status_code, _headers = get_policy_with_http_info(project_name, preheat_policy_name, opts)
|
417
|
+
data
|
418
|
+
end
|
419
|
+
|
420
|
+
# Get a preheat policy
|
421
|
+
# Get a preheat policy
|
422
|
+
# @param project_name The name of the project
|
423
|
+
# @param preheat_policy_name Preheat Policy Name
|
424
|
+
# @param [Hash] opts the optional parameters
|
425
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
426
|
+
# @return [Array<(PreheatPolicy, Fixnum, Hash)>] PreheatPolicy data, response status code and response headers
|
427
|
+
def get_policy_with_http_info(project_name, preheat_policy_name, opts = {})
|
428
|
+
if @api_client.config.debugging
|
429
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.get_policy ...'
|
430
|
+
end
|
431
|
+
# verify the required parameter 'project_name' is set
|
432
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
433
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.get_policy"
|
434
|
+
end
|
435
|
+
# verify the required parameter 'preheat_policy_name' is set
|
436
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
437
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.get_policy"
|
438
|
+
end
|
439
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
440
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_policy, the character length must be great than or equal to 1.'
|
441
|
+
end
|
442
|
+
|
443
|
+
# resource path
|
444
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)
|
445
|
+
|
446
|
+
# query parameters
|
447
|
+
query_params = {}
|
448
|
+
|
449
|
+
# header parameters
|
450
|
+
header_params = {}
|
451
|
+
# HTTP header 'Accept' (if needed)
|
452
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
453
|
+
# HTTP header 'Content-Type'
|
454
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
455
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
456
|
+
|
457
|
+
# form parameters
|
458
|
+
form_params = {}
|
459
|
+
|
460
|
+
# http body (model)
|
461
|
+
post_body = nil
|
462
|
+
auth_names = ['basic']
|
463
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
464
|
+
:header_params => header_params,
|
465
|
+
:query_params => query_params,
|
466
|
+
:form_params => form_params,
|
467
|
+
:body => post_body,
|
468
|
+
:auth_names => auth_names,
|
469
|
+
:return_type => 'PreheatPolicy')
|
470
|
+
if @api_client.config.debugging
|
471
|
+
@api_client.config.logger.debug "API called: PreheatApi#get_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
472
|
+
end
|
473
|
+
return data, status_code, headers
|
474
|
+
end
|
475
|
+
# Get the log text stream of the specified task for the given execution
|
476
|
+
# Get the log text stream of the specified task for the given execution
|
477
|
+
# @param project_name The name of the project
|
478
|
+
# @param preheat_policy_name Preheat Policy Name
|
479
|
+
# @param execution_id Execution ID
|
480
|
+
# @param task_id Task ID
|
481
|
+
# @param [Hash] opts the optional parameters
|
482
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
483
|
+
# @return [String]
|
484
|
+
def get_preheat_log(project_name, preheat_policy_name, execution_id, task_id, opts = {})
|
485
|
+
data, _status_code, _headers = get_preheat_log_with_http_info(project_name, preheat_policy_name, execution_id, task_id, opts)
|
486
|
+
data
|
487
|
+
end
|
488
|
+
|
489
|
+
# Get the log text stream of the specified task for the given execution
|
490
|
+
# Get the log text stream of the specified task for the given execution
|
491
|
+
# @param project_name The name of the project
|
492
|
+
# @param preheat_policy_name Preheat Policy Name
|
493
|
+
# @param execution_id Execution ID
|
494
|
+
# @param task_id Task ID
|
495
|
+
# @param [Hash] opts the optional parameters
|
496
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
497
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
498
|
+
def get_preheat_log_with_http_info(project_name, preheat_policy_name, execution_id, task_id, opts = {})
|
499
|
+
if @api_client.config.debugging
|
500
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.get_preheat_log ...'
|
501
|
+
end
|
502
|
+
# verify the required parameter 'project_name' is set
|
503
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
504
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.get_preheat_log"
|
505
|
+
end
|
506
|
+
# verify the required parameter 'preheat_policy_name' is set
|
507
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
508
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.get_preheat_log"
|
509
|
+
end
|
510
|
+
# verify the required parameter 'execution_id' is set
|
511
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
512
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.get_preheat_log"
|
513
|
+
end
|
514
|
+
# verify the required parameter 'task_id' is set
|
515
|
+
if @api_client.config.client_side_validation && task_id.nil?
|
516
|
+
fail ArgumentError, "Missing the required parameter 'task_id' when calling PreheatApi.get_preheat_log"
|
517
|
+
end
|
518
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
519
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_preheat_log, the character length must be great than or equal to 1.'
|
520
|
+
end
|
521
|
+
|
522
|
+
# resource path
|
523
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logs'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s).sub('{' + 'task_id' + '}', task_id.to_s)
|
524
|
+
|
525
|
+
# query parameters
|
526
|
+
query_params = {}
|
527
|
+
|
528
|
+
# header parameters
|
529
|
+
header_params = {}
|
530
|
+
# HTTP header 'Accept' (if needed)
|
531
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
532
|
+
# HTTP header 'Content-Type'
|
533
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
534
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
535
|
+
|
536
|
+
# form parameters
|
537
|
+
form_params = {}
|
538
|
+
|
539
|
+
# http body (model)
|
540
|
+
post_body = nil
|
541
|
+
auth_names = ['basic']
|
542
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
543
|
+
:header_params => header_params,
|
544
|
+
:query_params => query_params,
|
545
|
+
:form_params => form_params,
|
546
|
+
:body => post_body,
|
547
|
+
:auth_names => auth_names,
|
548
|
+
:return_type => 'String')
|
549
|
+
if @api_client.config.debugging
|
550
|
+
@api_client.config.logger.debug "API called: PreheatApi#get_preheat_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
551
|
+
end
|
552
|
+
return data, status_code, headers
|
553
|
+
end
|
554
|
+
# List executions for the given policy
|
555
|
+
# List executions for the given policy
|
556
|
+
# @param project_name The name of the project
|
557
|
+
# @param preheat_policy_name Preheat Policy Name
|
558
|
+
# @param [Hash] opts the optional parameters
|
559
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
560
|
+
# @option opts [Integer] :page The page number (default to 1)
|
561
|
+
# @option opts [Integer] :page_size The size of per page (default to 10)
|
562
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
563
|
+
# @return [Array<Execution>]
|
564
|
+
def list_executions(project_name, preheat_policy_name, opts = {})
|
565
|
+
data, _status_code, _headers = list_executions_with_http_info(project_name, preheat_policy_name, opts)
|
566
|
+
data
|
567
|
+
end
|
568
|
+
|
569
|
+
# List executions for the given policy
|
570
|
+
# List executions for the given policy
|
571
|
+
# @param project_name The name of the project
|
572
|
+
# @param preheat_policy_name Preheat Policy Name
|
573
|
+
# @param [Hash] opts the optional parameters
|
574
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
575
|
+
# @option opts [Integer] :page The page number
|
576
|
+
# @option opts [Integer] :page_size The size of per page
|
577
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
578
|
+
# @return [Array<(Array<Execution>, Fixnum, Hash)>] Array<Execution> data, response status code and response headers
|
579
|
+
def list_executions_with_http_info(project_name, preheat_policy_name, opts = {})
|
580
|
+
if @api_client.config.debugging
|
581
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.list_executions ...'
|
582
|
+
end
|
583
|
+
# verify the required parameter 'project_name' is set
|
584
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
585
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_executions"
|
586
|
+
end
|
587
|
+
# verify the required parameter 'preheat_policy_name' is set
|
588
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
589
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.list_executions"
|
590
|
+
end
|
591
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
592
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_executions, the character length must be great than or equal to 1.'
|
593
|
+
end
|
594
|
+
|
595
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
596
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_executions, must be smaller than or equal to 100.'
|
597
|
+
end
|
598
|
+
|
599
|
+
# resource path
|
600
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)
|
601
|
+
|
602
|
+
# query parameters
|
603
|
+
query_params = {}
|
604
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
605
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
606
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
607
|
+
|
608
|
+
# header parameters
|
609
|
+
header_params = {}
|
610
|
+
# HTTP header 'Accept' (if needed)
|
611
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
612
|
+
# HTTP header 'Content-Type'
|
613
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
614
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
615
|
+
|
616
|
+
# form parameters
|
617
|
+
form_params = {}
|
618
|
+
|
619
|
+
# http body (model)
|
620
|
+
post_body = nil
|
621
|
+
auth_names = ['basic']
|
622
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
623
|
+
:header_params => header_params,
|
624
|
+
:query_params => query_params,
|
625
|
+
:form_params => form_params,
|
626
|
+
:body => post_body,
|
627
|
+
:auth_names => auth_names,
|
628
|
+
:return_type => 'Array<Execution>')
|
629
|
+
if @api_client.config.debugging
|
630
|
+
@api_client.config.logger.debug "API called: PreheatApi#list_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
631
|
+
end
|
632
|
+
return data, status_code, headers
|
633
|
+
end
|
634
|
+
# List P2P provider instances
|
635
|
+
# List P2P provider instances
|
636
|
+
# @param [Hash] opts the optional parameters
|
637
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
638
|
+
# @option opts [Integer] :page The page number (default to 1)
|
639
|
+
# @option opts [Integer] :page_size The size of per page (default to 10)
|
640
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
641
|
+
# @return [Array<Instance>]
|
642
|
+
def list_instances(opts = {})
|
643
|
+
data, _status_code, _headers = list_instances_with_http_info(opts)
|
644
|
+
data
|
645
|
+
end
|
646
|
+
|
647
|
+
# List P2P provider instances
|
648
|
+
# List P2P provider instances
|
649
|
+
# @param [Hash] opts the optional parameters
|
650
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
651
|
+
# @option opts [Integer] :page The page number
|
652
|
+
# @option opts [Integer] :page_size The size of per page
|
653
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
654
|
+
# @return [Array<(Array<Instance>, Fixnum, Hash)>] Array<Instance> data, response status code and response headers
|
655
|
+
def list_instances_with_http_info(opts = {})
|
656
|
+
if @api_client.config.debugging
|
657
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.list_instances ...'
|
658
|
+
end
|
659
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
660
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_instances, the character length must be great than or equal to 1.'
|
661
|
+
end
|
662
|
+
|
663
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
664
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_instances, must be smaller than or equal to 100.'
|
665
|
+
end
|
666
|
+
|
667
|
+
# resource path
|
668
|
+
local_var_path = '/p2p/preheat/instances'
|
669
|
+
|
670
|
+
# query parameters
|
671
|
+
query_params = {}
|
672
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
673
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
674
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
675
|
+
|
676
|
+
# header parameters
|
677
|
+
header_params = {}
|
678
|
+
# HTTP header 'Accept' (if needed)
|
679
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
680
|
+
# HTTP header 'Content-Type'
|
681
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
682
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
683
|
+
|
684
|
+
# form parameters
|
685
|
+
form_params = {}
|
686
|
+
|
687
|
+
# http body (model)
|
688
|
+
post_body = nil
|
689
|
+
auth_names = ['basic']
|
690
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
691
|
+
:header_params => header_params,
|
692
|
+
:query_params => query_params,
|
693
|
+
:form_params => form_params,
|
694
|
+
:body => post_body,
|
695
|
+
:auth_names => auth_names,
|
696
|
+
:return_type => 'Array<Instance>')
|
697
|
+
if @api_client.config.debugging
|
698
|
+
@api_client.config.logger.debug "API called: PreheatApi#list_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
699
|
+
end
|
700
|
+
return data, status_code, headers
|
701
|
+
end
|
702
|
+
# List preheat policies
|
703
|
+
# List preheat policies
|
704
|
+
# @param project_name The name of the project
|
705
|
+
# @param [Hash] opts the optional parameters
|
706
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
707
|
+
# @option opts [Integer] :page The page number (default to 1)
|
708
|
+
# @option opts [Integer] :page_size The size of per page (default to 10)
|
709
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
710
|
+
# @return [Array<PreheatPolicy>]
|
711
|
+
def list_policies(project_name, opts = {})
|
712
|
+
data, _status_code, _headers = list_policies_with_http_info(project_name, opts)
|
713
|
+
data
|
714
|
+
end
|
715
|
+
|
716
|
+
# List preheat policies
|
717
|
+
# List preheat policies
|
718
|
+
# @param project_name The name of the project
|
719
|
+
# @param [Hash] opts the optional parameters
|
720
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
721
|
+
# @option opts [Integer] :page The page number
|
722
|
+
# @option opts [Integer] :page_size The size of per page
|
723
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
724
|
+
# @return [Array<(Array<PreheatPolicy>, Fixnum, Hash)>] Array<PreheatPolicy> data, response status code and response headers
|
725
|
+
def list_policies_with_http_info(project_name, opts = {})
|
726
|
+
if @api_client.config.debugging
|
727
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.list_policies ...'
|
728
|
+
end
|
729
|
+
# verify the required parameter 'project_name' is set
|
730
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
731
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_policies"
|
732
|
+
end
|
733
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
734
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_policies, the character length must be great than or equal to 1.'
|
735
|
+
end
|
736
|
+
|
737
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
738
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_policies, must be smaller than or equal to 100.'
|
739
|
+
end
|
740
|
+
|
741
|
+
# resource path
|
742
|
+
local_var_path = '/projects/{project_name}/preheat/policies'.sub('{' + 'project_name' + '}', project_name.to_s)
|
743
|
+
|
744
|
+
# query parameters
|
745
|
+
query_params = {}
|
746
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
747
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
748
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
749
|
+
|
750
|
+
# header parameters
|
751
|
+
header_params = {}
|
752
|
+
# HTTP header 'Accept' (if needed)
|
753
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
754
|
+
# HTTP header 'Content-Type'
|
755
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
756
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
757
|
+
|
758
|
+
# form parameters
|
759
|
+
form_params = {}
|
760
|
+
|
761
|
+
# http body (model)
|
762
|
+
post_body = nil
|
763
|
+
auth_names = ['basic']
|
764
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
765
|
+
:header_params => header_params,
|
766
|
+
:query_params => query_params,
|
767
|
+
:form_params => form_params,
|
768
|
+
:body => post_body,
|
769
|
+
:auth_names => auth_names,
|
770
|
+
:return_type => 'Array<PreheatPolicy>')
|
771
|
+
if @api_client.config.debugging
|
772
|
+
@api_client.config.logger.debug "API called: PreheatApi#list_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
773
|
+
end
|
774
|
+
return data, status_code, headers
|
775
|
+
end
|
776
|
+
# List P2P providers
|
777
|
+
# List P2P providers
|
778
|
+
# @param [Hash] opts the optional parameters
|
779
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
780
|
+
# @return [Array<Metadata>]
|
781
|
+
def list_providers(opts = {})
|
782
|
+
data, _status_code, _headers = list_providers_with_http_info(opts)
|
783
|
+
data
|
784
|
+
end
|
785
|
+
|
786
|
+
# List P2P providers
|
787
|
+
# List P2P providers
|
788
|
+
# @param [Hash] opts the optional parameters
|
789
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
790
|
+
# @return [Array<(Array<Metadata>, Fixnum, Hash)>] Array<Metadata> data, response status code and response headers
|
791
|
+
def list_providers_with_http_info(opts = {})
|
792
|
+
if @api_client.config.debugging
|
793
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.list_providers ...'
|
794
|
+
end
|
795
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
796
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_providers, the character length must be great than or equal to 1.'
|
797
|
+
end
|
798
|
+
|
799
|
+
# resource path
|
800
|
+
local_var_path = '/p2p/preheat/providers'
|
801
|
+
|
802
|
+
# query parameters
|
803
|
+
query_params = {}
|
804
|
+
|
805
|
+
# header parameters
|
806
|
+
header_params = {}
|
807
|
+
# HTTP header 'Accept' (if needed)
|
808
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
809
|
+
# HTTP header 'Content-Type'
|
810
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
811
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
812
|
+
|
813
|
+
# form parameters
|
814
|
+
form_params = {}
|
815
|
+
|
816
|
+
# http body (model)
|
817
|
+
post_body = nil
|
818
|
+
auth_names = ['basic']
|
819
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
820
|
+
:header_params => header_params,
|
821
|
+
:query_params => query_params,
|
822
|
+
:form_params => form_params,
|
823
|
+
:body => post_body,
|
824
|
+
:auth_names => auth_names,
|
825
|
+
:return_type => 'Array<Metadata>')
|
826
|
+
if @api_client.config.debugging
|
827
|
+
@api_client.config.logger.debug "API called: PreheatApi#list_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
828
|
+
end
|
829
|
+
return data, status_code, headers
|
830
|
+
end
|
831
|
+
# Get all providers at project level
|
832
|
+
# Get all providers at project level
|
833
|
+
# @param project_name The name of the project
|
834
|
+
# @param [Hash] opts the optional parameters
|
835
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
836
|
+
# @return [Array<ProviderUnderProject>]
|
837
|
+
def list_providers_under_project(project_name, opts = {})
|
838
|
+
data, _status_code, _headers = list_providers_under_project_with_http_info(project_name, opts)
|
839
|
+
data
|
840
|
+
end
|
841
|
+
|
842
|
+
# Get all providers at project level
|
843
|
+
# Get all providers at project level
|
844
|
+
# @param project_name The name of the project
|
845
|
+
# @param [Hash] opts the optional parameters
|
846
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
847
|
+
# @return [Array<(Array<ProviderUnderProject>, Fixnum, Hash)>] Array<ProviderUnderProject> data, response status code and response headers
|
848
|
+
def list_providers_under_project_with_http_info(project_name, opts = {})
|
849
|
+
if @api_client.config.debugging
|
850
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.list_providers_under_project ...'
|
851
|
+
end
|
852
|
+
# verify the required parameter 'project_name' is set
|
853
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
854
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_providers_under_project"
|
855
|
+
end
|
856
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
857
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_providers_under_project, the character length must be great than or equal to 1.'
|
858
|
+
end
|
859
|
+
|
860
|
+
# resource path
|
861
|
+
local_var_path = '/projects/{project_name}/preheat/providers'.sub('{' + 'project_name' + '}', project_name.to_s)
|
862
|
+
|
863
|
+
# query parameters
|
864
|
+
query_params = {}
|
865
|
+
|
866
|
+
# header parameters
|
867
|
+
header_params = {}
|
868
|
+
# HTTP header 'Accept' (if needed)
|
869
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
870
|
+
# HTTP header 'Content-Type'
|
871
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
872
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
873
|
+
|
874
|
+
# form parameters
|
875
|
+
form_params = {}
|
876
|
+
|
877
|
+
# http body (model)
|
878
|
+
post_body = nil
|
879
|
+
auth_names = ['basic']
|
880
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
881
|
+
:header_params => header_params,
|
882
|
+
:query_params => query_params,
|
883
|
+
:form_params => form_params,
|
884
|
+
:body => post_body,
|
885
|
+
:auth_names => auth_names,
|
886
|
+
:return_type => 'Array<ProviderUnderProject>')
|
887
|
+
if @api_client.config.debugging
|
888
|
+
@api_client.config.logger.debug "API called: PreheatApi#list_providers_under_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
889
|
+
end
|
890
|
+
return data, status_code, headers
|
891
|
+
end
|
892
|
+
# List all the related tasks for the given execution
|
893
|
+
# List all the related tasks for the given execution
|
894
|
+
# @param project_name The name of the project
|
895
|
+
# @param preheat_policy_name Preheat Policy Name
|
896
|
+
# @param execution_id Execution ID
|
897
|
+
# @param [Hash] opts the optional parameters
|
898
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
899
|
+
# @option opts [Integer] :page The page number (default to 1)
|
900
|
+
# @option opts [Integer] :page_size The size of per page (default to 10)
|
901
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
902
|
+
# @return [Array<Task>]
|
903
|
+
def list_tasks(project_name, preheat_policy_name, execution_id, opts = {})
|
904
|
+
data, _status_code, _headers = list_tasks_with_http_info(project_name, preheat_policy_name, execution_id, opts)
|
905
|
+
data
|
906
|
+
end
|
907
|
+
|
908
|
+
# List all the related tasks for the given execution
|
909
|
+
# List all the related tasks for the given execution
|
910
|
+
# @param project_name The name of the project
|
911
|
+
# @param preheat_policy_name Preheat Policy Name
|
912
|
+
# @param execution_id Execution ID
|
913
|
+
# @param [Hash] opts the optional parameters
|
914
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
915
|
+
# @option opts [Integer] :page The page number
|
916
|
+
# @option opts [Integer] :page_size The size of per page
|
917
|
+
# @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max]
|
918
|
+
# @return [Array<(Array<Task>, Fixnum, Hash)>] Array<Task> data, response status code and response headers
|
919
|
+
def list_tasks_with_http_info(project_name, preheat_policy_name, execution_id, opts = {})
|
920
|
+
if @api_client.config.debugging
|
921
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.list_tasks ...'
|
922
|
+
end
|
923
|
+
# verify the required parameter 'project_name' is set
|
924
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
925
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_tasks"
|
926
|
+
end
|
927
|
+
# verify the required parameter 'preheat_policy_name' is set
|
928
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
929
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.list_tasks"
|
930
|
+
end
|
931
|
+
# verify the required parameter 'execution_id' is set
|
932
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
933
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.list_tasks"
|
934
|
+
end
|
935
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
936
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_tasks, the character length must be great than or equal to 1.'
|
937
|
+
end
|
938
|
+
|
939
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
940
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_tasks, must be smaller than or equal to 100.'
|
941
|
+
end
|
942
|
+
|
943
|
+
# resource path
|
944
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s)
|
945
|
+
|
946
|
+
# query parameters
|
947
|
+
query_params = {}
|
948
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
949
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
950
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
951
|
+
|
952
|
+
# header parameters
|
953
|
+
header_params = {}
|
954
|
+
# HTTP header 'Accept' (if needed)
|
955
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
956
|
+
# HTTP header 'Content-Type'
|
957
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
958
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
959
|
+
|
960
|
+
# form parameters
|
961
|
+
form_params = {}
|
962
|
+
|
963
|
+
# http body (model)
|
964
|
+
post_body = nil
|
965
|
+
auth_names = ['basic']
|
966
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
967
|
+
:header_params => header_params,
|
968
|
+
:query_params => query_params,
|
969
|
+
:form_params => form_params,
|
970
|
+
:body => post_body,
|
971
|
+
:auth_names => auth_names,
|
972
|
+
:return_type => 'Array<Task>')
|
973
|
+
if @api_client.config.debugging
|
974
|
+
@api_client.config.logger.debug "API called: PreheatApi#list_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
975
|
+
end
|
976
|
+
return data, status_code, headers
|
977
|
+
end
|
978
|
+
# Manual preheat
|
979
|
+
# Manual preheat
|
980
|
+
# @param project_name The name of the project
|
981
|
+
# @param preheat_policy_name Preheat Policy Name
|
982
|
+
# @param policy The policy schema info
|
983
|
+
# @param [Hash] opts the optional parameters
|
984
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
985
|
+
# @return [nil]
|
986
|
+
def manual_preheat(project_name, preheat_policy_name, policy, opts = {})
|
987
|
+
manual_preheat_with_http_info(project_name, preheat_policy_name, policy, opts)
|
988
|
+
nil
|
989
|
+
end
|
990
|
+
|
991
|
+
# Manual preheat
|
992
|
+
# Manual preheat
|
993
|
+
# @param project_name The name of the project
|
994
|
+
# @param preheat_policy_name Preheat Policy Name
|
995
|
+
# @param policy The policy schema info
|
996
|
+
# @param [Hash] opts the optional parameters
|
997
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
998
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
999
|
+
def manual_preheat_with_http_info(project_name, preheat_policy_name, policy, opts = {})
|
1000
|
+
if @api_client.config.debugging
|
1001
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.manual_preheat ...'
|
1002
|
+
end
|
1003
|
+
# verify the required parameter 'project_name' is set
|
1004
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
1005
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.manual_preheat"
|
1006
|
+
end
|
1007
|
+
# verify the required parameter 'preheat_policy_name' is set
|
1008
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
1009
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.manual_preheat"
|
1010
|
+
end
|
1011
|
+
# verify the required parameter 'policy' is set
|
1012
|
+
if @api_client.config.client_side_validation && policy.nil?
|
1013
|
+
fail ArgumentError, "Missing the required parameter 'policy' when calling PreheatApi.manual_preheat"
|
1014
|
+
end
|
1015
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
1016
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.manual_preheat, the character length must be great than or equal to 1.'
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
# resource path
|
1020
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)
|
1021
|
+
|
1022
|
+
# query parameters
|
1023
|
+
query_params = {}
|
1024
|
+
|
1025
|
+
# header parameters
|
1026
|
+
header_params = {}
|
1027
|
+
# HTTP header 'Accept' (if needed)
|
1028
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1029
|
+
# HTTP header 'Content-Type'
|
1030
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1031
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
1032
|
+
|
1033
|
+
# form parameters
|
1034
|
+
form_params = {}
|
1035
|
+
|
1036
|
+
# http body (model)
|
1037
|
+
post_body = @api_client.object_to_http_body(policy)
|
1038
|
+
auth_names = ['basic']
|
1039
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1040
|
+
:header_params => header_params,
|
1041
|
+
:query_params => query_params,
|
1042
|
+
:form_params => form_params,
|
1043
|
+
:body => post_body,
|
1044
|
+
:auth_names => auth_names)
|
1045
|
+
if @api_client.config.debugging
|
1046
|
+
@api_client.config.logger.debug "API called: PreheatApi#manual_preheat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1047
|
+
end
|
1048
|
+
return data, status_code, headers
|
1049
|
+
end
|
1050
|
+
# Ping status of a instance.
|
1051
|
+
# This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)
|
1052
|
+
# @param instance The JSON object of instance.
|
1053
|
+
# @param [Hash] opts the optional parameters
|
1054
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1055
|
+
# @return [nil]
|
1056
|
+
def ping_instances(instance, opts = {})
|
1057
|
+
ping_instances_with_http_info(instance, opts)
|
1058
|
+
nil
|
1059
|
+
end
|
1060
|
+
|
1061
|
+
# Ping status of a instance.
|
1062
|
+
# This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)
|
1063
|
+
# @param instance The JSON object of instance.
|
1064
|
+
# @param [Hash] opts the optional parameters
|
1065
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1066
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
1067
|
+
def ping_instances_with_http_info(instance, opts = {})
|
1068
|
+
if @api_client.config.debugging
|
1069
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.ping_instances ...'
|
1070
|
+
end
|
1071
|
+
# verify the required parameter 'instance' is set
|
1072
|
+
if @api_client.config.client_side_validation && instance.nil?
|
1073
|
+
fail ArgumentError, "Missing the required parameter 'instance' when calling PreheatApi.ping_instances"
|
1074
|
+
end
|
1075
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
1076
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.ping_instances, the character length must be great than or equal to 1.'
|
1077
|
+
end
|
1078
|
+
|
1079
|
+
# resource path
|
1080
|
+
local_var_path = '/p2p/preheat/instances/ping'
|
1081
|
+
|
1082
|
+
# query parameters
|
1083
|
+
query_params = {}
|
1084
|
+
|
1085
|
+
# header parameters
|
1086
|
+
header_params = {}
|
1087
|
+
# HTTP header 'Accept' (if needed)
|
1088
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1089
|
+
# HTTP header 'Content-Type'
|
1090
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1091
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
1092
|
+
|
1093
|
+
# form parameters
|
1094
|
+
form_params = {}
|
1095
|
+
|
1096
|
+
# http body (model)
|
1097
|
+
post_body = @api_client.object_to_http_body(instance)
|
1098
|
+
auth_names = ['basic']
|
1099
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1100
|
+
:header_params => header_params,
|
1101
|
+
:query_params => query_params,
|
1102
|
+
:form_params => form_params,
|
1103
|
+
:body => post_body,
|
1104
|
+
:auth_names => auth_names)
|
1105
|
+
if @api_client.config.debugging
|
1106
|
+
@api_client.config.logger.debug "API called: PreheatApi#ping_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1107
|
+
end
|
1108
|
+
return data, status_code, headers
|
1109
|
+
end
|
1110
|
+
# Stop a execution
|
1111
|
+
# Stop a execution
|
1112
|
+
# @param project_name The name of the project
|
1113
|
+
# @param preheat_policy_name Preheat Policy Name
|
1114
|
+
# @param execution_id Execution ID
|
1115
|
+
# @param execution The data of execution
|
1116
|
+
# @param [Hash] opts the optional parameters
|
1117
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1118
|
+
# @return [nil]
|
1119
|
+
def stop_execution(project_name, preheat_policy_name, execution_id, execution, opts = {})
|
1120
|
+
stop_execution_with_http_info(project_name, preheat_policy_name, execution_id, execution, opts)
|
1121
|
+
nil
|
1122
|
+
end
|
1123
|
+
|
1124
|
+
# Stop a execution
|
1125
|
+
# Stop a execution
|
1126
|
+
# @param project_name The name of the project
|
1127
|
+
# @param preheat_policy_name Preheat Policy Name
|
1128
|
+
# @param execution_id Execution ID
|
1129
|
+
# @param execution The data of execution
|
1130
|
+
# @param [Hash] opts the optional parameters
|
1131
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1132
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
1133
|
+
def stop_execution_with_http_info(project_name, preheat_policy_name, execution_id, execution, opts = {})
|
1134
|
+
if @api_client.config.debugging
|
1135
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.stop_execution ...'
|
1136
|
+
end
|
1137
|
+
# verify the required parameter 'project_name' is set
|
1138
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
1139
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.stop_execution"
|
1140
|
+
end
|
1141
|
+
# verify the required parameter 'preheat_policy_name' is set
|
1142
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
1143
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.stop_execution"
|
1144
|
+
end
|
1145
|
+
# verify the required parameter 'execution_id' is set
|
1146
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
1147
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.stop_execution"
|
1148
|
+
end
|
1149
|
+
# verify the required parameter 'execution' is set
|
1150
|
+
if @api_client.config.client_side_validation && execution.nil?
|
1151
|
+
fail ArgumentError, "Missing the required parameter 'execution' when calling PreheatApi.stop_execution"
|
1152
|
+
end
|
1153
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
1154
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.stop_execution, the character length must be great than or equal to 1.'
|
1155
|
+
end
|
1156
|
+
|
1157
|
+
# resource path
|
1158
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s)
|
1159
|
+
|
1160
|
+
# query parameters
|
1161
|
+
query_params = {}
|
1162
|
+
|
1163
|
+
# header parameters
|
1164
|
+
header_params = {}
|
1165
|
+
# HTTP header 'Accept' (if needed)
|
1166
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1167
|
+
# HTTP header 'Content-Type'
|
1168
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1169
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
1170
|
+
|
1171
|
+
# form parameters
|
1172
|
+
form_params = {}
|
1173
|
+
|
1174
|
+
# http body (model)
|
1175
|
+
post_body = @api_client.object_to_http_body(execution)
|
1176
|
+
auth_names = ['basic']
|
1177
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
1178
|
+
:header_params => header_params,
|
1179
|
+
:query_params => query_params,
|
1180
|
+
:form_params => form_params,
|
1181
|
+
:body => post_body,
|
1182
|
+
:auth_names => auth_names)
|
1183
|
+
if @api_client.config.debugging
|
1184
|
+
@api_client.config.logger.debug "API called: PreheatApi#stop_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1185
|
+
end
|
1186
|
+
return data, status_code, headers
|
1187
|
+
end
|
1188
|
+
# Update the specified P2P provider instance
|
1189
|
+
# Update the specified P2P provider instance
|
1190
|
+
# @param preheat_instance_name Instance Name
|
1191
|
+
# @param instance The instance to update
|
1192
|
+
# @param [Hash] opts the optional parameters
|
1193
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1194
|
+
# @return [nil]
|
1195
|
+
def update_instance(preheat_instance_name, instance, opts = {})
|
1196
|
+
update_instance_with_http_info(preheat_instance_name, instance, opts)
|
1197
|
+
nil
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
# Update the specified P2P provider instance
|
1201
|
+
# Update the specified P2P provider instance
|
1202
|
+
# @param preheat_instance_name Instance Name
|
1203
|
+
# @param instance The instance to update
|
1204
|
+
# @param [Hash] opts the optional parameters
|
1205
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1206
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
1207
|
+
def update_instance_with_http_info(preheat_instance_name, instance, opts = {})
|
1208
|
+
if @api_client.config.debugging
|
1209
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.update_instance ...'
|
1210
|
+
end
|
1211
|
+
# verify the required parameter 'preheat_instance_name' is set
|
1212
|
+
if @api_client.config.client_side_validation && preheat_instance_name.nil?
|
1213
|
+
fail ArgumentError, "Missing the required parameter 'preheat_instance_name' when calling PreheatApi.update_instance"
|
1214
|
+
end
|
1215
|
+
# verify the required parameter 'instance' is set
|
1216
|
+
if @api_client.config.client_side_validation && instance.nil?
|
1217
|
+
fail ArgumentError, "Missing the required parameter 'instance' when calling PreheatApi.update_instance"
|
1218
|
+
end
|
1219
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
1220
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.update_instance, the character length must be great than or equal to 1.'
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
# resource path
|
1224
|
+
local_var_path = '/p2p/preheat/instances/{preheat_instance_name}'.sub('{' + 'preheat_instance_name' + '}', preheat_instance_name.to_s)
|
1225
|
+
|
1226
|
+
# query parameters
|
1227
|
+
query_params = {}
|
1228
|
+
|
1229
|
+
# header parameters
|
1230
|
+
header_params = {}
|
1231
|
+
# HTTP header 'Accept' (if needed)
|
1232
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1233
|
+
# HTTP header 'Content-Type'
|
1234
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1235
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
1236
|
+
|
1237
|
+
# form parameters
|
1238
|
+
form_params = {}
|
1239
|
+
|
1240
|
+
# http body (model)
|
1241
|
+
post_body = @api_client.object_to_http_body(instance)
|
1242
|
+
auth_names = ['basic']
|
1243
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1244
|
+
:header_params => header_params,
|
1245
|
+
:query_params => query_params,
|
1246
|
+
:form_params => form_params,
|
1247
|
+
:body => post_body,
|
1248
|
+
:auth_names => auth_names)
|
1249
|
+
if @api_client.config.debugging
|
1250
|
+
@api_client.config.logger.debug "API called: PreheatApi#update_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1251
|
+
end
|
1252
|
+
return data, status_code, headers
|
1253
|
+
end
|
1254
|
+
# Update preheat policy
|
1255
|
+
# Update preheat policy
|
1256
|
+
# @param project_name The name of the project
|
1257
|
+
# @param preheat_policy_name Preheat Policy Name
|
1258
|
+
# @param policy The policy schema info
|
1259
|
+
# @param [Hash] opts the optional parameters
|
1260
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1261
|
+
# @return [nil]
|
1262
|
+
def update_policy(project_name, preheat_policy_name, policy, opts = {})
|
1263
|
+
update_policy_with_http_info(project_name, preheat_policy_name, policy, opts)
|
1264
|
+
nil
|
1265
|
+
end
|
1266
|
+
|
1267
|
+
# Update preheat policy
|
1268
|
+
# Update preheat policy
|
1269
|
+
# @param project_name The name of the project
|
1270
|
+
# @param preheat_policy_name Preheat Policy Name
|
1271
|
+
# @param policy The policy schema info
|
1272
|
+
# @param [Hash] opts the optional parameters
|
1273
|
+
# @option opts [String] :x_request_id An unique ID for the request
|
1274
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
1275
|
+
def update_policy_with_http_info(project_name, preheat_policy_name, policy, opts = {})
|
1276
|
+
if @api_client.config.debugging
|
1277
|
+
@api_client.config.logger.debug 'Calling API: PreheatApi.update_policy ...'
|
1278
|
+
end
|
1279
|
+
# verify the required parameter 'project_name' is set
|
1280
|
+
if @api_client.config.client_side_validation && project_name.nil?
|
1281
|
+
fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.update_policy"
|
1282
|
+
end
|
1283
|
+
# verify the required parameter 'preheat_policy_name' is set
|
1284
|
+
if @api_client.config.client_side_validation && preheat_policy_name.nil?
|
1285
|
+
fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.update_policy"
|
1286
|
+
end
|
1287
|
+
# verify the required parameter 'policy' is set
|
1288
|
+
if @api_client.config.client_side_validation && policy.nil?
|
1289
|
+
fail ArgumentError, "Missing the required parameter 'policy' when calling PreheatApi.update_policy"
|
1290
|
+
end
|
1291
|
+
if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
|
1292
|
+
fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.update_policy, the character length must be great than or equal to 1.'
|
1293
|
+
end
|
1294
|
+
|
1295
|
+
# resource path
|
1296
|
+
local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)
|
1297
|
+
|
1298
|
+
# query parameters
|
1299
|
+
query_params = {}
|
1300
|
+
|
1301
|
+
# header parameters
|
1302
|
+
header_params = {}
|
1303
|
+
# HTTP header 'Accept' (if needed)
|
1304
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1305
|
+
# HTTP header 'Content-Type'
|
1306
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1307
|
+
header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
|
1308
|
+
|
1309
|
+
# form parameters
|
1310
|
+
form_params = {}
|
1311
|
+
|
1312
|
+
# http body (model)
|
1313
|
+
post_body = @api_client.object_to_http_body(policy)
|
1314
|
+
auth_names = ['basic']
|
1315
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1316
|
+
:header_params => header_params,
|
1317
|
+
:query_params => query_params,
|
1318
|
+
:form_params => form_params,
|
1319
|
+
:body => post_body,
|
1320
|
+
:auth_names => auth_names)
|
1321
|
+
if @api_client.config.debugging
|
1322
|
+
@api_client.config.logger.debug "API called: PreheatApi#update_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1323
|
+
end
|
1324
|
+
return data, status_code, headers
|
1325
|
+
end
|
1326
|
+
end
|
1327
|
+
end
|