github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/api/cloudcontroller/ccv2/internal/api_routes.go (about)

     1  package internal
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/tedsuo/rata"
     7  )
     8  
     9  // Naming convention:
    10  //
    11  // Method + non-parameter parts of the path
    12  //
    13  // If the request returns a single entity by GUID, use the singular (for example
    14  // /v2/organizations/:organization_guid is GetOrganization).
    15  //
    16  // The const name should always be the const value + Request.
    17  const (
    18  	DeleteOrganizationRequest                            = "DeleteOrganization"
    19  	DeleteRouteAppRequest                                = "DeleteRouteApp"
    20  	DeleteRouteRequest                                   = "DeleteRoute"
    21  	DeleteSecurityGroupSpaceRequest                      = "DeleteSecurityGroupSpace"
    22  	DeleteServiceBindingRequest                          = "DeleteServiceBinding"
    23  	DeleteSpaceRequest                                   = "DeleteSpace"
    24  	DeleteSecurityGroupStagingSpaceRequest               = "DeleteSecurityGroupStagingSpace"
    25  	GetAppInstancesRequest                               = "GetAppInstances"
    26  	GetAppRequest                                        = "GetApp"
    27  	GetAppRoutesRequest                                  = "GetAppRoutes"
    28  	GetAppsRequest                                       = "GetApps"
    29  	GetAppStatsRequest                                   = "GetAppStats"
    30  	GetConfigFeatureFlagsRequest                         = "GetConfigFeatureFlags"
    31  	GetInfoRequest                                       = "GetInfo"
    32  	GetJobRequest                                        = "GetJob"
    33  	GetOrganizationPrivateDomainsRequest                 = "GetOrganizationPrivateDomains"
    34  	GetOrganizationQuotaDefinitionRequest                = "GetOrganizationQuotaDefinition"
    35  	GetOrganizationRequest                               = "GetOrganization"
    36  	GetOrganizationsRequest                              = "GetOrganizations"
    37  	GetPrivateDomainRequest                              = "GetPrivateDomain"
    38  	GetRouteAppsRequest                                  = "GetRouteApps"
    39  	GetRouteReservedDeprecatedRequest                    = "GetRouteReservedDeprecated"
    40  	GetRouteReservedRequest                              = "GetRouteReserved"
    41  	GetRouteRouteMappingsRequest                         = "GetRouteRouteMappings"
    42  	GetRoutesRequest                                     = "GetRoutes"
    43  	GetSecurityGroupSpacesRequest                        = "GetSecurityGroupSpaces"
    44  	GetSecurityGroupsRequest                             = "GetSecurityGroups"
    45  	GetSecurityGroupStagingSpacesRequest                 = "GetSecurityGroupStagingSpaces"
    46  	GetServiceBindingsRequest                            = "GetServiceBindings"
    47  	GetServiceInstanceRequest                            = "GetServiceInstance"
    48  	GetServiceInstanceServiceBindingsRequest             = "GetServiceInstanceServiceBindings"
    49  	GetServiceInstanceSharedFromRequest                  = "GetServiceInstanceSharedFrom"
    50  	GetServiceInstanceSharedToRequest                    = "GetServiceInstanceSharedTo"
    51  	GetServiceInstancesRequest                           = "GetServiceInstances"
    52  	GetServicePlanRequest                                = "GetServicePlan"
    53  	GetServiceRequest                                    = "GetService"
    54  	GetSharedDomainRequest                               = "GetSharedDomain"
    55  	GetSharedDomainsRequest                              = "GetSharedDomains"
    56  	GetSpaceQuotaDefinitionRequest                       = "GetSpaceQuotaDefinition"
    57  	GetSpaceRoutesRequest                                = "GetSpaceRoutes"
    58  	GetSpaceSecurityGroupsRequest                        = "GetSpaceSecurityGroups"
    59  	GetSpaceServiceInstancesRequest                      = "GetSpaceServiceInstances"
    60  	GetSpacesRequest                                     = "GetSpaces"
    61  	GetSpaceStagingSecurityGroupsRequest                 = "GetSpaceStagingSecurityGroups"
    62  	GetStackRequest                                      = "GetStack"
    63  	GetStacksRequest                                     = "GetStacks"
    64  	GetUserProvidedServiceInstanceServiceBindingsRequest = "GetUserProvidedServiceInstanceServiceBindings"
    65  	GetUsersRequest                                      = "GetUsers"
    66  	PostAppRequest                                       = "PostApp"
    67  	PostAppRestageRequest                                = "PostAppRestage"
    68  	PostRouteRequest                                     = "PostRoute"
    69  	PostServiceBindingRequest                            = "PostServiceBinding"
    70  	PostUserRequest                                      = "PostUser"
    71  	PutAppBitsRequest                                    = "PutAppBits"
    72  	PutAppRequest                                        = "PutApp"
    73  	PutDropletRequest                                    = "PutDroplet"
    74  	PutResourceMatchRequest                              = "PutResourceMatch"
    75  	PutRouteAppRequest                                   = "PutRouteApp"
    76  	PutSecurityGroupSpaceRequest                         = "PutSecurityGroupSpace"
    77  	PutSecurityGroupStagingSpaceRequest                  = "PutSecurityGroupStagingSpace"
    78  )
    79  
    80  // APIRoutes is a list of routes used by the rata library to construct request
    81  // URLs.
    82  var APIRoutes = rata.Routes{
    83  	{Path: "/v2/apps", Method: http.MethodGet, Name: GetAppsRequest},
    84  	{Path: "/v2/apps", Method: http.MethodPost, Name: PostAppRequest},
    85  	{Path: "/v2/apps/:app_guid", Method: http.MethodGet, Name: GetAppRequest},
    86  	{Path: "/v2/apps/:app_guid", Method: http.MethodPut, Name: PutAppRequest},
    87  	{Path: "/v2/apps/:app_guid/bits", Method: http.MethodPut, Name: PutAppBitsRequest},
    88  	{Path: "/v2/apps/:app_guid/droplet/upload", Method: http.MethodPut, Name: PutDropletRequest},
    89  	{Path: "/v2/apps/:app_guid/instances", Method: http.MethodGet, Name: GetAppInstancesRequest},
    90  	{Path: "/v2/apps/:app_guid/restage", Method: http.MethodPost, Name: PostAppRestageRequest},
    91  	{Path: "/v2/apps/:app_guid/routes", Method: http.MethodGet, Name: GetAppRoutesRequest},
    92  	{Path: "/v2/apps/:app_guid/stats", Method: http.MethodGet, Name: GetAppStatsRequest},
    93  	{Path: "/v2/config/feature_flags", Method: http.MethodGet, Name: GetConfigFeatureFlagsRequest},
    94  	{Path: "/v2/info", Method: http.MethodGet, Name: GetInfoRequest},
    95  	{Path: "/v2/jobs/:job_guid", Method: http.MethodGet, Name: GetJobRequest},
    96  	{Path: "/v2/organizations", Method: http.MethodGet, Name: GetOrganizationsRequest},
    97  	{Path: "/v2/organizations/:organization_guid", Method: http.MethodDelete, Name: DeleteOrganizationRequest},
    98  	{Path: "/v2/organizations/:organization_guid", Method: http.MethodGet, Name: GetOrganizationRequest},
    99  	{Path: "/v2/organizations/:organization_guid/private_domains", Method: http.MethodGet, Name: GetOrganizationPrivateDomainsRequest},
   100  	{Path: "/v2/private_domains/:private_domain_guid", Method: http.MethodGet, Name: GetPrivateDomainRequest},
   101  	{Path: "/v2/quota_definitions/:organization_quota_guid", Method: http.MethodGet, Name: GetOrganizationQuotaDefinitionRequest},
   102  	{Path: "/v2/resource_match", Method: http.MethodPut, Name: PutResourceMatchRequest},
   103  	{Path: "/v2/routes", Method: http.MethodGet, Name: GetRoutesRequest},
   104  	{Path: "/v2/routes", Method: http.MethodPost, Name: PostRouteRequest},
   105  	{Path: "/v2/routes/:route_guid", Method: http.MethodDelete, Name: DeleteRouteRequest},
   106  	{Path: "/v2/routes/:route_guid/apps", Method: http.MethodGet, Name: GetRouteAppsRequest},
   107  	{Path: "/v2/routes/:route_guid/apps/:app_guid", Method: http.MethodDelete, Name: DeleteRouteAppRequest},
   108  	{Path: "/v2/routes/:route_guid/apps/:app_guid", Method: http.MethodPut, Name: PutRouteAppRequest},
   109  	{Path: "/v2/routes/:route_guid/route_mappings", Method: http.MethodGet, Name: GetRouteRouteMappingsRequest},
   110  	{Path: "/v2/routes/reserved/domain/:domain_guid", Method: http.MethodGet, Name: GetRouteReservedRequest},
   111  	{Path: "/v2/routes/reserved/domain/:domain_guid/host/:host", Method: http.MethodGet, Name: GetRouteReservedDeprecatedRequest},
   112  	{Path: "/v2/security_groups", Method: http.MethodGet, Name: GetSecurityGroupsRequest},
   113  	{Path: "/v2/security_groups/:security_group_guid/spaces", Method: http.MethodGet, Name: GetSecurityGroupSpacesRequest},
   114  	{Path: "/v2/security_groups/:security_group_guid/spaces/:space_guid", Method: http.MethodDelete, Name: DeleteSecurityGroupSpaceRequest},
   115  	{Path: "/v2/security_groups/:security_group_guid/spaces/:space_guid", Method: http.MethodPut, Name: PutSecurityGroupSpaceRequest},
   116  	{Path: "/v2/security_groups/:security_group_guid/staging_spaces", Method: http.MethodGet, Name: GetSecurityGroupStagingSpacesRequest},
   117  	{Path: "/v2/security_groups/:security_group_guid/staging_spaces/:space_guid", Method: http.MethodDelete, Name: DeleteSecurityGroupStagingSpaceRequest},
   118  	{Path: "/v2/security_groups/:security_group_guid/staging_spaces/:space_guid", Method: http.MethodPut, Name: PutSecurityGroupStagingSpaceRequest},
   119  	{Path: "/v2/service_bindings", Method: http.MethodGet, Name: GetServiceBindingsRequest},
   120  	{Path: "/v2/service_bindings", Method: http.MethodPost, Name: PostServiceBindingRequest},
   121  	{Path: "/v2/service_bindings/:service_binding_guid", Method: http.MethodDelete, Name: DeleteServiceBindingRequest},
   122  	{Path: "/v2/service_instances", Method: http.MethodGet, Name: GetServiceInstancesRequest},
   123  	{Path: "/v2/service_instances/:service_instance_guid", Method: http.MethodGet, Name: GetServiceInstanceRequest},
   124  	{Path: "/v2/service_instances/:service_instance_guid/service_bindings", Method: http.MethodGet, Name: GetServiceInstanceServiceBindingsRequest},
   125  	{Path: "/v2/service_instances/:service_instance_guid/shared_from", Method: http.MethodGet, Name: GetServiceInstanceSharedFromRequest},
   126  	{Path: "/v2/service_instances/:service_instance_guid/shared_to", Method: http.MethodGet, Name: GetServiceInstanceSharedToRequest},
   127  	{Path: "/v2/service_plans/:service_plan_guid", Method: http.MethodGet, Name: GetServicePlanRequest},
   128  	{Path: "/v2/services/:service_guid", Method: http.MethodGet, Name: GetServiceRequest},
   129  	{Path: "/v2/shared_domains", Method: http.MethodGet, Name: GetSharedDomainsRequest},
   130  	{Path: "/v2/shared_domains/:shared_domain_guid", Method: http.MethodGet, Name: GetSharedDomainRequest},
   131  	{Path: "/v2/space_quota_definitions/:space_quota_guid", Method: http.MethodGet, Name: GetSpaceQuotaDefinitionRequest},
   132  	{Path: "/v2/spaces", Method: http.MethodGet, Name: GetSpacesRequest},
   133  	{Path: "/v2/spaces/:guid/service_instances", Method: http.MethodGet, Name: GetSpaceServiceInstancesRequest},
   134  	{Path: "/v2/spaces/:space_guid", Method: http.MethodDelete, Name: DeleteSpaceRequest},
   135  	{Path: "/v2/spaces/:space_guid/routes", Method: http.MethodGet, Name: GetSpaceRoutesRequest},
   136  	{Path: "/v2/spaces/:space_guid/security_groups", Method: http.MethodGet, Name: GetSpaceSecurityGroupsRequest},
   137  	{Path: "/v2/spaces/:space_guid/staging_security_groups", Method: http.MethodGet, Name: GetSpaceStagingSecurityGroupsRequest},
   138  	{Path: "/v2/stacks", Method: http.MethodGet, Name: GetStacksRequest},
   139  	{Path: "/v2/stacks/:stack_guid", Method: http.MethodGet, Name: GetStackRequest},
   140  	{Path: "/v2/user_provided_service_instances/:user_provided_service_instance_guid/service_bindings", Method: http.MethodGet, Name: GetUserProvidedServiceInstanceServiceBindingsRequest},
   141  	{Path: "/v2/users", Method: http.MethodPost, Name: PostUserRequest},
   142  }