-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstorageservice.yaml
174 lines (163 loc) · 6.72 KB
/
storageservice.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
swagger: "2.0"
################################################################################
# Service Metadata #
################################################################################
info:
version: "1.0"
title: A Storage Service
description: |
This is a minimal definition for a Storage service.
Contains:
- Solution event lifecycle to create/clear solution namespace.
- Solution context id injected to operation parameter.
contact:
name: maintainer name
email: [email protected]
################################################################################
# API Information #
################################################################################
# A hostname with a valid, signed, and active TSL certificate is required.
host: google.com
basePath: /
################################################################################
# Solution lifecycle Events #
################################################################################
# Following Operation should generally be restricted with "x-exosite-restricted: true"
x-exosite-init: createSolution # Triggered by Murano when this service is enabled in a solution
x-exosite-info: getSolution # Triggered by Murano to retrieve custom information about the service solution namespace
x-exosite-update: updateSolution # Triggered by Murano when the solution service configuration is updated
x-exosite-gc: delSolution # Triggered by Murano when the service is removed from a solution or if the solution is deleted
################################################################################
# Service Configuration Parameters #
################################################################################
x-exosite-config-parameters:
- name: configurationParameter
type: string
description: This is a mandatory parameter for the service to be usable.
required: true # Indicates this parameter is required during configuration
################################################################################
# Operations #
################################################################################
paths:
# Administration endpoint used by Murano solution lifecycle events
# Those operation uses the "x-exosite-restricted" to prevent the user to access them directly
/{solution_id}:
parameters:
- name: solution_id
x-exosite-from: solution_id # Indicate this value is injected from the user solution_id
x-exosite-restricted: true # Indicate the user cannot provide this parameter
type: string
in: path
description: The solution identifier. Set automatically.
required: true
post:
description: Used by Murano to create a solution namespace.
operationId: createSolution
x-exosite-restricted: true # Indicate that this operation cannot be called from user scripts
parameters:
- name: settings
in: body
description: The service settings for a solution.
required: true
schema:
$ref: "#/definitions/SolutionSettings"
responses:
default:
description: Solution successfully created
get:
description: Used by Murano to get the solution settings.
operationId: getSolution
responses:
default:
description: Solution settings
schema:
$ref: "#/definitions/SolutionInfo"
put:
description: Used by Murano to update the solution settings.
operationId: updateSolution
x-exosite-restricted: true
parameters:
- name: settings
in: body
description: The service settings for a solution.
required: true
schema:
$ref: "#/definitions/SolutionSettings"
responses:
default:
description: Settings updated
delete:
description: Used by Murano to remove a solution and clean its namespace.
operationId: delSolution
x-exosite-restricted: true
responses:
default:
description: Solution successfully removed.
# Service operations available from scripting
/{solution_id}/data:
parameters:
- name: solution_id
type: string
in: path
description: The solution identifier. Set automatically by Murano at service call.
x-exosite-from: solution_id # Indicate this value is injected from the user solution_id
x-exosite-restricted: true # Indicate the user cannot provide this parameter
required: true
post:
description: Save data to the solution namespace.
operationId: setData
x-exosite-example: >
local params = {
data = "hello"
}
local result = Storageservice.setData(params)
parameters:
- name: body
in: body
description: Data to save.
required: true
schema:
$ref: "#/definitions/Body"
responses:
default:
description: Data successfully saved
get:
description: Retrieve data from the solution namespace.
operationId: getData
x-exosite-example: >
local result = Storageservice.getData() -- return hello
responses:
default:
description: Successfully returned the solution data
schema:
$ref: "#/definitions/Body"
################################################################################
# Definitions #
################################################################################
definitions:
Body:
type: object
description: Request payload
properties:
data:
type: string
description: Data saved in the storage
ConfigurationParameter:
type: string
description: This is a mandatory parameter for the service to be usable.
SolutionSettings:
description: The service settings for a solution.
type: object
properties:
configurationParameter:
$ref: "#/definitions/ConfigurationParameter"
required: [configurationParameter]
SolutionInfo:
description: The service settings & information for a solution.
type: object
properties:
configurationParameter:
$ref: "#/definitions/ConfigurationParameter"
additionalInfo:
type: object
description: Some additional information from the service used for display purpose