-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_routes.go
220 lines (216 loc) · 17.6 KB
/
api_routes.go
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
package internal
import (
"net/http"
"github.com/tedsuo/rata"
)
// Naming convention:
//
// Method + non-parameter parts of the path
//
// If the request returns a single entity by GUID, use the singular (for example
// /v2/organizations/:organization_guid is GetOrganization).
//
// The const name should always be the const value + Request.
const (
DeleteOrganizationRequest = "DeleteOrganization"
DeleteRouteAppRequest = "DeleteRouteApp"
DeleteRouteRequest = "DeleteRoute"
DeleteSecurityGroupSpaceRequest = "DeleteSecurityGroupSpace"
DeleteSecurityGroupStagingSpaceRequest = "DeleteSecurityGroupStagingSpace"
DeleteServiceBindingRequest = "DeleteServiceBinding"
DeleteServicePlanVisibilityRequest = "DeleteServicePlanVisibility"
DeleteServiceRequest = "DeleteService"
DeleteSpaceRequest = "DeleteSpace"
DeleteSpaceUnmappedRoutesRequest = "DeleteUnmappedRoutes"
GetAppInstancesRequest = "GetAppInstances"
GetAppRequest = "GetApp"
GetAppRoutesRequest = "GetAppRoutes"
GetAppsRequest = "GetApps"
GetAppStatsRequest = "GetAppStats"
GetBuildpacksRequest = "GetBuildpacks"
GetConfigFeatureFlagsRequest = "GetConfigFeatureFlags"
GetEventsRequest = "GetEvents"
GetInfoRequest = "GetInfo"
GetJobRequest = "GetJob"
GetOrganizationPrivateDomainsRequest = "GetOrganizationPrivateDomains"
GetOrganizationQuotaDefinitionsRequest = "GetOrganizationQuotaDefinitions"
GetOrganizationQuotaDefinitionRequest = "GetOrganizationQuotaDefinition"
GetOrganizationRequest = "GetOrganization"
GetOrganizationsRequest = "GetOrganizations"
GetPrivateDomainRequest = "GetPrivateDomain"
GetPrivateDomainsRequest = "GetPrivateDomains"
GetRouteAppsRequest = "GetRouteApps"
GetRouteMappingRequest = "GetRouteMapping"
GetRouteMappingsRequest = "GetRouteMappings"
GetRouteRequest = "GetRoute"
GetRouteReservedDeprecatedRequest = "GetRouteReservedDeprecated"
GetRouteReservedRequest = "GetRouteReserved"
GetRouteRouteMappingsRequest = "GetRouteRouteMappings"
GetRoutesRequest = "GetRoutes"
GetSecurityGroupSpacesRequest = "GetSecurityGroupSpaces"
GetSecurityGroupsRequest = "GetSecurityGroups"
GetSecurityGroupStagingSpacesRequest = "GetSecurityGroupStagingSpaces"
GetServiceBindingRequest = "GetServiceBinding"
GetServiceBindingsRequest = "GetServiceBindings"
GetServiceBrokersRequest = "GetServiceBrokers"
GetServiceInstanceRequest = "GetServiceInstance"
GetServiceInstanceServiceBindingsRequest = "GetServiceInstanceServiceBindings"
GetServiceInstanceSharedFromRequest = "GetServiceInstanceSharedFrom"
GetServiceInstanceSharedToRequest = "GetServiceInstanceSharedTo"
GetServiceInstancesRequest = "GetServiceInstances"
GetServicePlanRequest = "GetServicePlan"
GetServicePlansRequest = "GetServicePlans"
GetServicePlanVisibilitiesRequest = "GetServicePlanVisibilities"
GetServiceRequest = "GetService"
GetServicesRequest = "GetServices"
GetSharedDomainRequest = "GetSharedDomain"
GetSharedDomainsRequest = "GetSharedDomains"
GetOrganizationSpaceQuotasRequest = "GetOrganizationSpaceQuotas"
GetSpaceQuotaDefinitionRequest = "GetSpaceQuotaDefinition"
GetSpaceRoutesRequest = "GetSpaceRoutes"
GetSpaceSecurityGroupsRequest = "GetSpaceSecurityGroups"
GetSpaceServicesRequest = "GetSpaceServices"
GetSpaceServiceInstancesRequest = "GetSpaceServiceInstances"
GetSpaceSummaryRequest = "GetSpaceSummary"
GetSpacesRequest = "GetSpaces"
GetSpaceStagingSecurityGroupsRequest = "GetSpaceStagingSecurityGroups"
GetStackRequest = "GetStack"
GetStacksRequest = "GetStacks"
GetUserProvidedServiceInstanceServiceBindingsRequest = "GetUserProvidedServiceInstanceServiceBindings"
GetUserProvidedServiceInstancesRequest = "GetUserProvidedServiceInstances"
GetUsersRequest = "GetUsers"
PostAppRequest = "PostApp"
PostAppRestageRequest = "PostAppRestage"
PostBuildpackRequest = "PostBuildpack"
PostOrganizationRequest = "PostOrganization"
PostRouteRequest = "PostRoute"
PostServiceBindingRequest = "PostServiceBinding"
PostServiceInstancesRequest = "PostServiceInstance"
PostSharedDomainRequest = "PostSharedDomain"
PostServiceBrokerRequest = "PostServiceBroker"
PostServiceKeyRequest = "PostServiceKey"
PostServicePlanVisibilityRequest = "PostServicePlanVisibility"
PostSpaceRequest = "PostSpace"
PostUserRequest = "PostUser"
PutAppBitsRequest = "PutAppBits"
PutAppRequest = "PutApp"
PutBuildpackRequest = "PutBuildpack"
PutBuildpackBitsRequest = "PutBuildpackBits"
PutDropletRequest = "PutDroplet"
PutOrganizationManagerByUsernameRequest = "PutOrganizationManagerByUsername"
PutOrganizationManagerRequest = "PutOrganizationManager"
PutOrganizationUserRequest = "PutOrganizationUser"
PutOrganizationUserByUsernameRequest = "PutOrganizationUserByUsername"
PutResourceMatchRequest = "PutResourceMatch"
PutRouteAppRequest = "PutRouteApp"
PutServicePlanRequest = "PutServicePlan"
PutSpaceQuotaRequest = "PutSpaceQuotaRequest"
PutSpaceDeveloperRequest = "PutSpaceDeveloper"
PutSpaceDeveloperByUsernameRequest = "PutSpaceDeveloperByUsername"
PutSpaceManagerRequest = "PutSpaceManager"
PutSpaceManagerByUsernameRequest = "PutSpaceManagerByUsername"
PutSecurityGroupSpaceRequest = "PutSecurityGroupSpace"
PutSecurityGroupStagingSpaceRequest = "PutSecurityGroupStagingSpace"
)
// APIRoutes is a list of routes used by the rata library to construct request
// URLs.
var APIRoutes = rata.Routes{
{Path: "/v2/apps", Method: http.MethodGet, Name: GetAppsRequest},
{Path: "/v2/apps", Method: http.MethodPost, Name: PostAppRequest},
{Path: "/v2/apps/:app_guid", Method: http.MethodGet, Name: GetAppRequest},
{Path: "/v2/apps/:app_guid", Method: http.MethodPut, Name: PutAppRequest},
{Path: "/v2/apps/:app_guid/bits", Method: http.MethodPut, Name: PutAppBitsRequest},
{Path: "/v2/apps/:app_guid/droplet/upload", Method: http.MethodPut, Name: PutDropletRequest},
{Path: "/v2/apps/:app_guid/instances", Method: http.MethodGet, Name: GetAppInstancesRequest},
{Path: "/v2/apps/:app_guid/restage", Method: http.MethodPost, Name: PostAppRestageRequest},
{Path: "/v2/apps/:app_guid/routes", Method: http.MethodGet, Name: GetAppRoutesRequest},
{Path: "/v2/apps/:app_guid/stats", Method: http.MethodGet, Name: GetAppStatsRequest},
{Path: "/v2/buildpacks", Method: http.MethodPost, Name: PostBuildpackRequest},
{Path: "/v2/buildpacks", Method: http.MethodGet, Name: GetBuildpacksRequest},
{Path: "/v2/buildpacks/:buildpack_guid", Method: http.MethodPut, Name: PutBuildpackRequest},
{Path: "/v2/buildpacks/:buildpack_guid/bits", Method: http.MethodPut, Name: PutBuildpackBitsRequest},
{Path: "/v2/config/feature_flags", Method: http.MethodGet, Name: GetConfigFeatureFlagsRequest},
{Path: "/v2/events", Method: http.MethodGet, Name: GetEventsRequest},
{Path: "/v2/info", Method: http.MethodGet, Name: GetInfoRequest},
{Path: "/v2/jobs/:job_guid", Method: http.MethodGet, Name: GetJobRequest},
{Path: "/v2/organizations", Method: http.MethodGet, Name: GetOrganizationsRequest},
{Path: "/v2/organizations", Method: http.MethodPost, Name: PostOrganizationRequest},
{Path: "/v2/organizations/:organization_guid", Method: http.MethodDelete, Name: DeleteOrganizationRequest},
{Path: "/v2/organizations/:organization_guid", Method: http.MethodGet, Name: GetOrganizationRequest},
{Path: "/v2/organizations/:organization_guid/managers", Method: http.MethodPut, Name: PutOrganizationManagerByUsernameRequest},
{Path: "/v2/organizations/:organization_guid/managers/:manager_guid", Method: http.MethodPut, Name: PutOrganizationManagerRequest},
{Path: "/v2/organizations/:organization_guid/private_domains", Method: http.MethodGet, Name: GetOrganizationPrivateDomainsRequest},
{Path: "/v2/organizations/:organization_guid/users", Method: http.MethodPut, Name: PutOrganizationUserByUsernameRequest},
{Path: "/v2/organizations/:organization_guid/users/:user_guid", Method: http.MethodPut, Name: PutOrganizationUserRequest},
{Path: "/v2/private_domains", Method: http.MethodGet, Name: GetPrivateDomainsRequest},
{Path: "/v2/private_domains/:private_domain_guid", Method: http.MethodGet, Name: GetPrivateDomainRequest},
{Path: "/v2/quota_definitions/:organization_quota_guid", Method: http.MethodGet, Name: GetOrganizationQuotaDefinitionRequest},
{Path: "/v2/quota_definitions", Method: http.MethodGet, Name: GetOrganizationQuotaDefinitionsRequest},
{Path: "/v2/resource_match", Method: http.MethodPut, Name: PutResourceMatchRequest},
{Path: "/v2/route_mappings", Method: http.MethodGet, Name: GetRouteMappingsRequest},
{Path: "/v2/route_mappings/:route_mapping_guid", Method: http.MethodGet, Name: GetRouteMappingRequest},
{Path: "/v2/routes", Method: http.MethodGet, Name: GetRoutesRequest},
{Path: "/v2/routes", Method: http.MethodPost, Name: PostRouteRequest},
{Path: "/v2/routes/:route_guid", Method: http.MethodDelete, Name: DeleteRouteRequest},
{Path: "/v2/routes/:route_guid", Method: http.MethodGet, Name: GetRouteRequest},
{Path: "/v2/routes/:route_guid/apps", Method: http.MethodGet, Name: GetRouteAppsRequest},
{Path: "/v2/routes/:route_guid/apps/:app_guid", Method: http.MethodDelete, Name: DeleteRouteAppRequest},
{Path: "/v2/routes/:route_guid/apps/:app_guid", Method: http.MethodPut, Name: PutRouteAppRequest},
{Path: "/v2/routes/:route_guid/route_mappings", Method: http.MethodGet, Name: GetRouteRouteMappingsRequest},
{Path: "/v2/routes/reserved/domain/:domain_guid", Method: http.MethodGet, Name: GetRouteReservedRequest},
{Path: "/v2/routes/reserved/domain/:domain_guid/host/:host", Method: http.MethodGet, Name: GetRouteReservedDeprecatedRequest},
{Path: "/v2/security_groups", Method: http.MethodGet, Name: GetSecurityGroupsRequest},
{Path: "/v2/security_groups/:security_group_guid/spaces", Method: http.MethodGet, Name: GetSecurityGroupSpacesRequest},
{Path: "/v2/security_groups/:security_group_guid/spaces/:space_guid", Method: http.MethodDelete, Name: DeleteSecurityGroupSpaceRequest},
{Path: "/v2/security_groups/:security_group_guid/spaces/:space_guid", Method: http.MethodPut, Name: PutSecurityGroupSpaceRequest},
{Path: "/v2/security_groups/:security_group_guid/staging_spaces", Method: http.MethodGet, Name: GetSecurityGroupStagingSpacesRequest},
{Path: "/v2/security_groups/:security_group_guid/staging_spaces/:space_guid", Method: http.MethodDelete, Name: DeleteSecurityGroupStagingSpaceRequest},
{Path: "/v2/security_groups/:security_group_guid/staging_spaces/:space_guid", Method: http.MethodPut, Name: PutSecurityGroupStagingSpaceRequest},
{Path: "/v2/service_bindings", Method: http.MethodGet, Name: GetServiceBindingsRequest},
{Path: "/v2/service_bindings", Method: http.MethodPost, Name: PostServiceBindingRequest},
{Path: "/v2/service_bindings/:service_binding_guid", Method: http.MethodDelete, Name: DeleteServiceBindingRequest},
{Path: "/v2/service_bindings/:service_binding_guid", Method: http.MethodGet, Name: GetServiceBindingRequest},
{Path: "/v2/service_brokers", Method: http.MethodGet, Name: GetServiceBrokersRequest},
{Path: "/v2/service_brokers", Method: http.MethodPost, Name: PostServiceBrokerRequest},
{Path: "/v2/service_instances", Method: http.MethodGet, Name: GetServiceInstancesRequest},
{Path: "/v2/service_instances", Method: http.MethodPost, Name: PostServiceInstancesRequest},
{Path: "/v2/service_instances/:service_instance_guid", Method: http.MethodGet, Name: GetServiceInstanceRequest},
{Path: "/v2/service_instances/:service_instance_guid/service_bindings", Method: http.MethodGet, Name: GetServiceInstanceServiceBindingsRequest},
{Path: "/v2/service_instances/:service_instance_guid/shared_from", Method: http.MethodGet, Name: GetServiceInstanceSharedFromRequest},
{Path: "/v2/service_instances/:service_instance_guid/shared_to", Method: http.MethodGet, Name: GetServiceInstanceSharedToRequest},
{Path: "/v2/service_keys", Method: http.MethodPost, Name: PostServiceKeyRequest},
{Path: "/v2/service_plan_visibilities", Method: http.MethodGet, Name: GetServicePlanVisibilitiesRequest},
{Path: "/v2/service_plan_visibilities", Method: http.MethodPost, Name: PostServicePlanVisibilityRequest},
{Path: "/v2/service_plan_visibilities/:service_plan_visibility_guid", Method: http.MethodDelete, Name: DeleteServicePlanVisibilityRequest},
{Path: "/v2/service_plans", Method: http.MethodGet, Name: GetServicePlansRequest},
{Path: "/v2/service_plans/:service_plan_guid", Method: http.MethodPut, Name: PutServicePlanRequest},
{Path: "/v2/service_plans/:service_plan_guid", Method: http.MethodGet, Name: GetServicePlanRequest},
{Path: "/v2/services", Method: http.MethodGet, Name: GetServicesRequest},
{Path: "/v2/services/:service_guid", Method: http.MethodGet, Name: GetServiceRequest},
{Path: "/v2/services/:service_guid", Method: http.MethodDelete, Name: DeleteServiceRequest},
{Path: "/v2/shared_domains", Method: http.MethodGet, Name: GetSharedDomainsRequest},
{Path: "/v2/shared_domains", Method: http.MethodPost, Name: PostSharedDomainRequest},
{Path: "/v2/shared_domains/:shared_domain_guid", Method: http.MethodGet, Name: GetSharedDomainRequest},
{Path: "/v2/organizations/:organization_guid/space_quota_definitions", Method: http.MethodGet, Name: GetOrganizationSpaceQuotasRequest},
{Path: "/v2/space_quota_definitions/:space_quota_guid/spaces/:space_guid", Method: http.MethodPut, Name: PutSpaceQuotaRequest},
{Path: "/v2/space_quota_definitions/:space_quota_guid", Method: http.MethodGet, Name: GetSpaceQuotaDefinitionRequest},
{Path: "/v2/spaces/:space_guid/summary", Method: http.MethodGet, Name: GetSpaceSummaryRequest},
{Path: "/v2/spaces", Method: http.MethodGet, Name: GetSpacesRequest},
{Path: "/v2/spaces", Method: http.MethodPost, Name: PostSpaceRequest},
{Path: "/v2/spaces/:space_guid/developers", Method: http.MethodPut, Name: PutSpaceDeveloperByUsernameRequest},
{Path: "/v2/spaces/:space_guid/developers/:developer_guid", Method: http.MethodPut, Name: PutSpaceDeveloperRequest},
{Path: "/v2/spaces/:guid/service_instances", Method: http.MethodGet, Name: GetSpaceServiceInstancesRequest},
{Path: "/v2/spaces/:space_guid/services", Method: http.MethodGet, Name: GetSpaceServicesRequest},
{Path: "/v2/spaces/:space_guid", Method: http.MethodDelete, Name: DeleteSpaceRequest},
{Path: "/v2/spaces/:space_guid/routes", Method: http.MethodGet, Name: GetSpaceRoutesRequest},
{Path: "/v2/spaces/:space_guid/security_groups", Method: http.MethodGet, Name: GetSpaceSecurityGroupsRequest},
{Path: "/v2/spaces/:space_guid/staging_security_groups", Method: http.MethodGet, Name: GetSpaceStagingSecurityGroupsRequest},
{Path: "/v2/spaces/:space_guid/managers", Method: http.MethodPut, Name: PutSpaceManagerByUsernameRequest},
{Path: "/v2/spaces/:space_guid/managers/:manager_guid", Method: http.MethodPut, Name: PutSpaceManagerRequest},
{Path: "/v2/spaces/:space_guid/unmapped_routes", Method: http.MethodDelete, Name: DeleteSpaceUnmappedRoutesRequest},
{Path: "/v2/stacks", Method: http.MethodGet, Name: GetStacksRequest},
{Path: "/v2/stacks/:stack_guid", Method: http.MethodGet, Name: GetStackRequest},
{Path: "/v2/user_provided_service_instances", Method: http.MethodGet, Name: GetUserProvidedServiceInstancesRequest},
{Path: "/v2/user_provided_service_instances/:user_provided_service_instance_guid/service_bindings", Method: http.MethodGet, Name: GetUserProvidedServiceInstanceServiceBindingsRequest},
{Path: "/v2/users", Method: http.MethodPost, Name: PostUserRequest},
}