losant_rest 1.16.1 → 1.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/_schemas.md +1260 -316
- data/docs/applications.md +1 -1
- data/docs/instanceSandbox.md +135 -0
- data/docs/instanceSandboxes.md +53 -0
- data/lib/losant_rest/client.rb +10 -2
- data/lib/losant_rest/instance_sandbox.rb +181 -0
- data/lib/losant_rest/instance_sandboxes.rb +94 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest.rb +2 -0
- data/schemas/apiTokenPost.json +7 -1
- data/schemas/applicationDashboardPost.json +3 -0
- data/schemas/applicationExportPost.json +1 -0
- data/schemas/applicationSearchResult.json +2 -1
- data/schemas/applicationTemplateCategories.json +11 -0
- data/schemas/applicationTemplateCategory.json +11 -0
- data/schemas/dashboard.json +3 -0
- data/schemas/dashboardPatch.json +3 -0
- data/schemas/dashboardPost.json +3 -0
- data/schemas/dashboardSendReport.json +3 -0
- data/schemas/dashboards.json +3 -0
- data/schemas/dataExport.json +1 -0
- data/schemas/devicesDeletePost.json +5 -0
- data/schemas/devicesExportPayloadCountPost.json +1 -0
- data/schemas/devicesExportPost.json +1 -0
- data/schemas/devicesPatch.json +5 -0
- data/schemas/embeddedDeploymentExport.json +5 -0
- data/schemas/eventsExport.json +1 -0
- data/schemas/flowVersionsDeletePost.json +5 -0
- data/schemas/githubLogin.json +7 -1
- data/schemas/importIntoApplicationOptions.json +52 -0
- data/schemas/importNewApplicationOptions.json +44 -0
- data/schemas/instance.json +1 -0
- data/schemas/instanceOrg.json +30 -0
- data/schemas/instanceOrgPatch.json +29 -0
- data/schemas/instanceOrgPost.json +29 -0
- data/schemas/instanceOrgs.json +30 -0
- data/schemas/instancePatch.json +1 -0
- data/schemas/instanceReportOptionsPost.json +1 -0
- data/schemas/instanceSandbox.json +423 -0
- data/schemas/instanceSandboxes.json +48 -0
- data/schemas/notebookDataExportOptions.json +5 -0
- data/schemas/org.json +17 -0
- data/schemas/orgs.json +17 -0
- data/schemas/userCredentials.json +7 -1
- data/schemas/userPost.json +7 -1
- metadata +10 -2
data/docs/applications.md
CHANGED
@@ -82,7 +82,7 @@ all.Organization, all.User, applications.*, or applications.import.
|
|
82
82
|
| includeDataTableRows | string | N | If set, import data table rows from import bundle | | true |
|
83
83
|
| includeFiles | string | N | If set, import files from import bundle | | true |
|
84
84
|
| email | string | N | Email address to notify the user when the job to import the application has completed or errored, defaults to the email address of the user making the request | | email@example.com |
|
85
|
-
| options | [
|
85
|
+
| options | [Applications Import Options](_schemas.md#applications-import-options) | N | Additional import options | | [Applications Import Options Example](_schemas.md#applications-import-options-example) |
|
86
86
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
87
87
|
|
88
88
|
#### Successful Responses
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# Instance Sandbox Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Instance Sandbox resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Delete](#delete)
|
10
|
+
* [Get](#get)
|
11
|
+
* [Undelete](#undelete)
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
## Delete
|
16
|
+
|
17
|
+
Deletes a sandbox user account
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
result = client.instance_sandbox.delete(
|
21
|
+
instanceId: my_instance_id,
|
22
|
+
instanceSandboxId: my_instance_sandbox_id)
|
23
|
+
|
24
|
+
puts result
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Authentication
|
28
|
+
The client must be configured with a valid api access token to call this
|
29
|
+
action. The token must include at least one of the following scopes:
|
30
|
+
all.Instance, all.User, instanceSandbox.*, or instanceSandbox.delete.
|
31
|
+
|
32
|
+
#### Available Parameters
|
33
|
+
|
34
|
+
| Name | Type | Required | Description | Default | Example |
|
35
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
36
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
37
|
+
| instanceSandboxId | string | Y | ID associated with the sandbox user | | 575ec8687ae143cd83dc4a97 |
|
38
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
39
|
+
|
40
|
+
#### Successful Responses
|
41
|
+
|
42
|
+
| Code | Type | Description |
|
43
|
+
| ---- | ---- | ----------- |
|
44
|
+
| 200 | [Success](_schemas.md#success) | If a sandbox was successfully deleted |
|
45
|
+
|
46
|
+
#### Error Responses
|
47
|
+
|
48
|
+
| Code | Type | Description |
|
49
|
+
| ---- | ---- | ----------- |
|
50
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
51
|
+
| 404 | [Error](_schemas.md#error) | Error if instance, organization or invite was not found |
|
52
|
+
|
53
|
+
<br/>
|
54
|
+
|
55
|
+
## Get
|
56
|
+
|
57
|
+
Returns a sandbox user
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
result = client.instance_sandbox.get(
|
61
|
+
instanceId: my_instance_id,
|
62
|
+
instanceSandboxId: my_instance_sandbox_id)
|
63
|
+
|
64
|
+
puts result
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Authentication
|
68
|
+
The client must be configured with a valid api access token to call this
|
69
|
+
action. The token must include at least one of the following scopes:
|
70
|
+
all.Instance, all.Instance.read, all.User, all.User.read, instanceSandbox.*, or instanceSandbox.get.
|
71
|
+
|
72
|
+
#### Available Parameters
|
73
|
+
|
74
|
+
| Name | Type | Required | Description | Default | Example |
|
75
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
76
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
77
|
+
| instanceSandboxId | string | Y | ID associated with the sandbox user | | 575ec8687ae143cd83dc4a97 |
|
78
|
+
| summaryExclude | string | N | Comma-separated list of summary fields to exclude from user summary | | payloadCount |
|
79
|
+
| summaryInclude | string | N | Comma-separated list of summary fields to include in user summary | | payloadCount |
|
80
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
81
|
+
|
82
|
+
#### Successful Responses
|
83
|
+
|
84
|
+
| Code | Type | Description |
|
85
|
+
| ---- | ---- | ----------- |
|
86
|
+
| 200 | [Instance Sandbox User](_schemas.md#instance-sandbox-user) | A single sandbox user |
|
87
|
+
|
88
|
+
#### Error Responses
|
89
|
+
|
90
|
+
| Code | Type | Description |
|
91
|
+
| ---- | ---- | ----------- |
|
92
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
93
|
+
| 404 | [Error](_schemas.md#error) | Error if sandbox was not found |
|
94
|
+
|
95
|
+
<br/>
|
96
|
+
|
97
|
+
## Undelete
|
98
|
+
|
99
|
+
Restores a sandbox user account
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
result = client.instance_sandbox.undelete(
|
103
|
+
instanceId: my_instance_id,
|
104
|
+
instanceSandboxId: my_instance_sandbox_id)
|
105
|
+
|
106
|
+
puts result
|
107
|
+
```
|
108
|
+
|
109
|
+
#### Authentication
|
110
|
+
The client must be configured with a valid api access token to call this
|
111
|
+
action. The token must include at least one of the following scopes:
|
112
|
+
all.Instance, all.User, instanceSandbox.*, or instanceSandbox.undelete.
|
113
|
+
|
114
|
+
#### Available Parameters
|
115
|
+
|
116
|
+
| Name | Type | Required | Description | Default | Example |
|
117
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
118
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
119
|
+
| instanceSandboxId | string | Y | ID associated with the sandbox user | | 575ec8687ae143cd83dc4a97 |
|
120
|
+
| summaryExclude | string | N | Comma-separated list of summary fields to exclude from user summary | | payloadCount |
|
121
|
+
| summaryInclude | string | N | Comma-separated list of summary fields to include in user summary | | payloadCount |
|
122
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
123
|
+
|
124
|
+
#### Successful Responses
|
125
|
+
|
126
|
+
| Code | Type | Description |
|
127
|
+
| ---- | ---- | ----------- |
|
128
|
+
| 200 | [Instance Sandbox User](_schemas.md#instance-sandbox-user) | A single restored sandbox user |
|
129
|
+
|
130
|
+
#### Error Responses
|
131
|
+
|
132
|
+
| Code | Type | Description |
|
133
|
+
| ---- | ---- | ----------- |
|
134
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
135
|
+
| 404 | [Error](_schemas.md#error) | Error if sandbox was not found |
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Instance Sandboxes Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Instance Sandboxes resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
|
11
|
+
<br/>
|
12
|
+
|
13
|
+
## Get
|
14
|
+
|
15
|
+
Returns a collection of instance sandboxes
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
result = client.instance_sandboxes.get(instanceId: my_instance_id)
|
19
|
+
|
20
|
+
puts result
|
21
|
+
```
|
22
|
+
|
23
|
+
#### Authentication
|
24
|
+
The client must be configured with a valid api access token to call this
|
25
|
+
action. The token must include at least one of the following scopes:
|
26
|
+
all.Instance, all.Instance.read, all.User, all.User.read, instanceSandboxes.*, or instanceSandboxes.get.
|
27
|
+
|
28
|
+
#### Available Parameters
|
29
|
+
|
30
|
+
| Name | Type | Required | Description | Default | Example |
|
31
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
32
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
33
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: firstName, lastName, email, id, creationDate, lastSuccessfulLogin, lastFailedLogin, failedLoginCount, lastUpdated | email | firstName |
|
34
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
35
|
+
| startingAfterId | string | N | Exclusive ID from which to begin querying | | 575ec8687ae143cd83dc4a97 |
|
36
|
+
| endingBeforeId | string | N | Exclusive ID at which to end querying | | 575ec8687ae143cd83dc4a97 |
|
37
|
+
| limit | string | N | How many items to return | 100 | 10 |
|
38
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: firstName, lastName, email | | firstName |
|
39
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * instance |
|
40
|
+
| includeDeleted | string | N | If the result of the request should also include deleted sandboxes. | | true |
|
41
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
42
|
+
|
43
|
+
#### Successful Responses
|
44
|
+
|
45
|
+
| Code | Type | Description |
|
46
|
+
| ---- | ---- | ----------- |
|
47
|
+
| 200 | [Instance Sandboxes](_schemas.md#instance-sandboxes) | Collection of instance sandboxes |
|
48
|
+
|
49
|
+
#### Error Responses
|
50
|
+
|
51
|
+
| Code | Type | Description |
|
52
|
+
| ---- | ---- | ----------- |
|
53
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
data/lib/losant_rest/client.rb
CHANGED
@@ -27,7 +27,7 @@ module LosantRest
|
|
27
27
|
#
|
28
28
|
# User API for accessing Losant data
|
29
29
|
#
|
30
|
-
# Built For Version 1.23.
|
30
|
+
# Built For Version 1.23.2
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -308,6 +308,14 @@ module LosantRest
|
|
308
308
|
@instance_orgs ||= InstanceOrgs.new(self)
|
309
309
|
end
|
310
310
|
|
311
|
+
def instance_sandbox
|
312
|
+
@instance_sandbox ||= InstanceSandbox.new(self)
|
313
|
+
end
|
314
|
+
|
315
|
+
def instance_sandboxes
|
316
|
+
@instance_sandboxes ||= InstanceSandboxes.new(self)
|
317
|
+
end
|
318
|
+
|
311
319
|
def instances
|
312
320
|
@instances ||= Instances.new(self)
|
313
321
|
end
|
@@ -366,7 +374,7 @@ module LosantRest
|
|
366
374
|
|
367
375
|
headers["Accept"] = "application/json"
|
368
376
|
headers["Content-Type"] = "application/json"
|
369
|
-
headers["Accept-Version"] = "^1.23.
|
377
|
+
headers["Accept-Version"] = "^1.23.2"
|
370
378
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
371
379
|
path = self.url + options.fetch(:path, "")
|
372
380
|
|
@@ -0,0 +1,181 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2022 Losant IoT, Inc.
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require "json"
|
24
|
+
|
25
|
+
module LosantRest
|
26
|
+
|
27
|
+
# Class containing all the actions for the Instance Sandbox Resource
|
28
|
+
class InstanceSandbox
|
29
|
+
|
30
|
+
def initialize(client)
|
31
|
+
@client = client
|
32
|
+
end
|
33
|
+
|
34
|
+
# Deletes a sandbox user account
|
35
|
+
#
|
36
|
+
# Authentication:
|
37
|
+
# The client must be configured with a valid api
|
38
|
+
# access token to call this action. The token
|
39
|
+
# must include at least one of the following scopes:
|
40
|
+
# all.Instance, all.User, instanceSandbox.*, or instanceSandbox.delete.
|
41
|
+
#
|
42
|
+
# Parameters:
|
43
|
+
# * {string} instanceId - ID associated with the instance
|
44
|
+
# * {string} instanceSandboxId - ID associated with the sandbox user
|
45
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
46
|
+
# * {boolean} _actions - Return resource actions in response
|
47
|
+
# * {boolean} _links - Return resource link in response
|
48
|
+
# * {boolean} _embedded - Return embedded resources in response
|
49
|
+
#
|
50
|
+
# Responses:
|
51
|
+
# * 200 - If a sandbox was successfully deleted (https://api.losant.com/#/definitions/success)
|
52
|
+
#
|
53
|
+
# Errors:
|
54
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
55
|
+
# * 404 - Error if instance, organization or invite was not found (https://api.losant.com/#/definitions/error)
|
56
|
+
def delete(params = {})
|
57
|
+
params = Utils.symbolize_hash_keys(params)
|
58
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
59
|
+
headers = {}
|
60
|
+
body = nil
|
61
|
+
|
62
|
+
raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
|
63
|
+
raise ArgumentError.new("instanceSandboxId is required") unless params.has_key?(:instanceSandboxId)
|
64
|
+
|
65
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
66
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
67
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
68
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
69
|
+
|
70
|
+
path = "/instances/#{params[:instanceId]}/sandboxes/#{params[:instanceSandboxId]}"
|
71
|
+
|
72
|
+
@client.request(
|
73
|
+
method: :delete,
|
74
|
+
path: path,
|
75
|
+
query: query_params,
|
76
|
+
headers: headers,
|
77
|
+
body: body)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Returns a sandbox user
|
81
|
+
#
|
82
|
+
# Authentication:
|
83
|
+
# The client must be configured with a valid api
|
84
|
+
# access token to call this action. The token
|
85
|
+
# must include at least one of the following scopes:
|
86
|
+
# all.Instance, all.Instance.read, all.User, all.User.read, instanceSandbox.*, or instanceSandbox.get.
|
87
|
+
#
|
88
|
+
# Parameters:
|
89
|
+
# * {string} instanceId - ID associated with the instance
|
90
|
+
# * {string} instanceSandboxId - ID associated with the sandbox user
|
91
|
+
# * {string} summaryExclude - Comma-separated list of summary fields to exclude from user summary
|
92
|
+
# * {string} summaryInclude - Comma-separated list of summary fields to include in user summary
|
93
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
94
|
+
# * {boolean} _actions - Return resource actions in response
|
95
|
+
# * {boolean} _links - Return resource link in response
|
96
|
+
# * {boolean} _embedded - Return embedded resources in response
|
97
|
+
#
|
98
|
+
# Responses:
|
99
|
+
# * 200 - A single sandbox user (https://api.losant.com/#/definitions/instanceSandbox)
|
100
|
+
#
|
101
|
+
# Errors:
|
102
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
103
|
+
# * 404 - Error if sandbox was not found (https://api.losant.com/#/definitions/error)
|
104
|
+
def get(params = {})
|
105
|
+
params = Utils.symbolize_hash_keys(params)
|
106
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
107
|
+
headers = {}
|
108
|
+
body = nil
|
109
|
+
|
110
|
+
raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
|
111
|
+
raise ArgumentError.new("instanceSandboxId is required") unless params.has_key?(:instanceSandboxId)
|
112
|
+
|
113
|
+
query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude)
|
114
|
+
query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
|
115
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
116
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
117
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
118
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
119
|
+
|
120
|
+
path = "/instances/#{params[:instanceId]}/sandboxes/#{params[:instanceSandboxId]}"
|
121
|
+
|
122
|
+
@client.request(
|
123
|
+
method: :get,
|
124
|
+
path: path,
|
125
|
+
query: query_params,
|
126
|
+
headers: headers,
|
127
|
+
body: body)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Restores a sandbox user account
|
131
|
+
#
|
132
|
+
# Authentication:
|
133
|
+
# The client must be configured with a valid api
|
134
|
+
# access token to call this action. The token
|
135
|
+
# must include at least one of the following scopes:
|
136
|
+
# all.Instance, all.User, instanceSandbox.*, or instanceSandbox.undelete.
|
137
|
+
#
|
138
|
+
# Parameters:
|
139
|
+
# * {string} instanceId - ID associated with the instance
|
140
|
+
# * {string} instanceSandboxId - ID associated with the sandbox user
|
141
|
+
# * {string} summaryExclude - Comma-separated list of summary fields to exclude from user summary
|
142
|
+
# * {string} summaryInclude - Comma-separated list of summary fields to include in user summary
|
143
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
144
|
+
# * {boolean} _actions - Return resource actions in response
|
145
|
+
# * {boolean} _links - Return resource link in response
|
146
|
+
# * {boolean} _embedded - Return embedded resources in response
|
147
|
+
#
|
148
|
+
# Responses:
|
149
|
+
# * 200 - A single restored sandbox user (https://api.losant.com/#/definitions/instanceSandbox)
|
150
|
+
#
|
151
|
+
# Errors:
|
152
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
153
|
+
# * 404 - Error if sandbox was not found (https://api.losant.com/#/definitions/error)
|
154
|
+
def undelete(params = {})
|
155
|
+
params = Utils.symbolize_hash_keys(params)
|
156
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
157
|
+
headers = {}
|
158
|
+
body = nil
|
159
|
+
|
160
|
+
raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
|
161
|
+
raise ArgumentError.new("instanceSandboxId is required") unless params.has_key?(:instanceSandboxId)
|
162
|
+
|
163
|
+
query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude)
|
164
|
+
query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
|
165
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
166
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
167
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
168
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
169
|
+
|
170
|
+
path = "/instances/#{params[:instanceId]}/sandboxes/#{params[:instanceSandboxId]}/undelete"
|
171
|
+
|
172
|
+
@client.request(
|
173
|
+
method: :patch,
|
174
|
+
path: path,
|
175
|
+
query: query_params,
|
176
|
+
headers: headers,
|
177
|
+
body: body)
|
178
|
+
end
|
179
|
+
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2022 Losant IoT, Inc.
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require "json"
|
24
|
+
|
25
|
+
module LosantRest
|
26
|
+
|
27
|
+
# Class containing all the actions for the Instance Sandboxes Resource
|
28
|
+
class InstanceSandboxes
|
29
|
+
|
30
|
+
def initialize(client)
|
31
|
+
@client = client
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a collection of instance sandboxes
|
35
|
+
#
|
36
|
+
# Authentication:
|
37
|
+
# The client must be configured with a valid api
|
38
|
+
# access token to call this action. The token
|
39
|
+
# must include at least one of the following scopes:
|
40
|
+
# all.Instance, all.Instance.read, all.User, all.User.read, instanceSandboxes.*, or instanceSandboxes.get.
|
41
|
+
#
|
42
|
+
# Parameters:
|
43
|
+
# * {string} instanceId - ID associated with the instance
|
44
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: firstName, lastName, email, id, creationDate, lastSuccessfulLogin, lastFailedLogin, failedLoginCount, lastUpdated
|
45
|
+
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
46
|
+
# * {string} startingAfterId - Exclusive ID from which to begin querying
|
47
|
+
# * {string} endingBeforeId - Exclusive ID at which to end querying
|
48
|
+
# * {string} limit - How many items to return
|
49
|
+
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: firstName, lastName, email
|
50
|
+
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
51
|
+
# * {string} includeDeleted - If the result of the request should also include deleted sandboxes.
|
52
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
53
|
+
# * {boolean} _actions - Return resource actions in response
|
54
|
+
# * {boolean} _links - Return resource link in response
|
55
|
+
# * {boolean} _embedded - Return embedded resources in response
|
56
|
+
#
|
57
|
+
# Responses:
|
58
|
+
# * 200 - Collection of instance sandboxes (https://api.losant.com/#/definitions/instanceSandboxes)
|
59
|
+
#
|
60
|
+
# Errors:
|
61
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
62
|
+
def get(params = {})
|
63
|
+
params = Utils.symbolize_hash_keys(params)
|
64
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
65
|
+
headers = {}
|
66
|
+
body = nil
|
67
|
+
|
68
|
+
raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
|
69
|
+
|
70
|
+
query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
|
71
|
+
query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
|
72
|
+
query_params[:startingAfterId] = params[:startingAfterId] if params.has_key?(:startingAfterId)
|
73
|
+
query_params[:endingBeforeId] = params[:endingBeforeId] if params.has_key?(:endingBeforeId)
|
74
|
+
query_params[:limit] = params[:limit] if params.has_key?(:limit)
|
75
|
+
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
76
|
+
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
77
|
+
query_params[:includeDeleted] = params[:includeDeleted] if params.has_key?(:includeDeleted)
|
78
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
79
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
80
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
81
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
82
|
+
|
83
|
+
path = "/instances/#{params[:instanceId]}/sandboxes"
|
84
|
+
|
85
|
+
@client.request(
|
86
|
+
method: :get,
|
87
|
+
path: path,
|
88
|
+
query: query_params,
|
89
|
+
headers: headers,
|
90
|
+
body: body)
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
end
|
data/lib/losant_rest/version.rb
CHANGED
data/lib/losant_rest.rb
CHANGED
@@ -91,6 +91,8 @@ require_relative "losant_rest/instance_org_invites"
|
|
91
91
|
require_relative "losant_rest/instance_org_member"
|
92
92
|
require_relative "losant_rest/instance_org_members"
|
93
93
|
require_relative "losant_rest/instance_orgs"
|
94
|
+
require_relative "losant_rest/instance_sandbox"
|
95
|
+
require_relative "losant_rest/instance_sandboxes"
|
94
96
|
require_relative "losant_rest/instances"
|
95
97
|
require_relative "losant_rest/integration"
|
96
98
|
require_relative "losant_rest/integrations"
|
data/schemas/apiTokenPost.json
CHANGED
@@ -390,7 +390,13 @@
|
|
390
390
|
"instanceCustomNode.patch",
|
391
391
|
"instanceCustomNode.delete",
|
392
392
|
"instanceCustomNode.errors",
|
393
|
-
"instanceCustomNode.stats"
|
393
|
+
"instanceCustomNode.stats",
|
394
|
+
"instanceSandbox.*",
|
395
|
+
"instanceSandbox.get",
|
396
|
+
"instanceSandbox.delete",
|
397
|
+
"instanceSandbox.undelete",
|
398
|
+
"instanceSandboxes.*",
|
399
|
+
"instanceSandboxes.get"
|
394
400
|
]
|
395
401
|
},
|
396
402
|
{
|
data/schemas/dashboard.json
CHANGED
data/schemas/dashboardPatch.json
CHANGED
data/schemas/dashboardPost.json
CHANGED
data/schemas/dashboards.json
CHANGED