-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage-facility.raml
128 lines (106 loc) · 3.89 KB
/
storage-facility.raml
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
#%RAML 1.0
title: Storage Facility Service API
version: v1
baseUri: http://localhost:6890/api
annotationTypes: !include types/annotations.raml
types: !include types/storage-facility/types.raml
# The default media type is JSON. Each resource can override that
# as needed.
mediaType: application/json
# RAML resourceTypes are templates for resource definitions.
resourceTypes:
change-status: !include resourceTypes/change-status.raml
collection: !include resourceTypes/collection.raml
collection-item: !include resourceTypes/collection-item.raml
heartbeat: !include resourceTypes/heartbeat.raml
shutdown: !include resourceTypes/shutdown.raml
########################################################################
# Internal Resources
########################################################################
/internal/heartbeat:
type: heartbeat
/internal/shutdown:
type: shutdown
########################################################################
# Public Resources
########################################################################
# The storage-facilities top-level endpoint defines the contract
# for managing StorageFacility instances as being:
#
# The collection holds unique instances.
# Logical uniqueness is defined by the "name" property.
# Clients are expected to provide unique names.
#
/{company}/storage-facilities:
uriParameters:
company:
type: CompanySlug
type:
collection:
collectionResource: StorageFacilities
existingResource: StorageFacility
newResource: NewStorageFacility
# The client can optionally provide what known embedded
# resources should be resolved and returned within the
# StorageFacility resources.
get:
queryParameters:
expand?: StorageFacilitiesExpansion
put:
# Individual storage facility instances are made available under
# this endpoint. The "facility" must be the entity URN or UUID.
/{facility}:
uriParameters:
facility:
type: UUID | URN
type:
collection-item:
resource: StorageFacility
itemIdParameter: facility
itemIdType: string
# The client can optionally provide what known embedded
# resources should be resolved and returned within the
# StorageFacility resource.
get:
queryParameters:
expand?: StorageFacilityExpansion
# The client can optionally provide what known embedded
# resources should be resolved and returned within the
# StorageFacility resource.
post:
queryParameters:
expand?: StorageFacilityExpansion
# Attempt to activate the StorageFacility, succeeding when the
# current StorageFacilityStatus allows transitioning to
# "Active." If it is semantically valid for this endpoint to
# be invoked for any given StorageFacility, it will be
# provided by the service within the `_links` array.
/activate:
type:
change-status:
resource: StorageFacility
itemIdParameter: facility
itemIdType: string
# The client can optionally provide what known embedded
# resources should be resolved and returned within the
# StorageFacility resource.
post:
queryParameters:
expand?: StorageFacilityExpansion
# Attempt to close the StorageFacility, succeeding when the
# current StorageFacilityStatus allows transitioning to
# "Closed." If it is semantically valid for this endpoint to
# be invoked for any given StorageFacility, it will be
# provided by the service within the `_links` array.
/close:
type:
change-status:
resource: StorageFacility
itemIdParameter: facility
itemIdType: string
# The client can optionally provide what known embedded
# resources should be resolved and returned within the
# StorageFacility resource.
post:
queryParameters:
expand?: StorageFacilityExpansion