github.com/willmadison/cli@v6.40.1-0.20181018160101-29d5937903ff+incompatible/api/cloudcontroller/ccv3/internal/api_routes.go (about) 1 package internal 2 3 import "net/http" 4 5 // Naming convention: 6 // 7 // HTTP method + non-parameter parts of the path + "Request" 8 // 9 // If the request returns a single entity by GUID, use the singular (for example 10 // /v2/organizations/:organization_guid is GetOrganization). 11 const ( 12 DeleteApplicationProcessInstanceRequest = "DeleteApplicationProcessInstance" 13 DeleteApplicationRequest = "DeleteApplication" 14 DeleteIsolationSegmentRelationshipOrganizationRequest = "DeleteIsolationSegmentRelationshipOrganization" 15 DeleteIsolationSegmentRequest = "DeleteIsolationSegment" 16 DeleteServiceInstanceRelationshipsSharedSpaceRequest = "DeleteServiceInstanceRelationshipsSharedSpace" 17 GetApplicationDropletCurrentRequest = "GetApplicationDropletCurrent" 18 GetApplicationEnvRequest = "GetApplicationEnv" 19 GetApplicationProcessesRequest = "GetApplicationProcesses" 20 GetApplicationProcessRequest = "GetApplicationProcess" 21 GetApplicationsRequest = "GetApplications" 22 GetApplicationTasksRequest = "GetApplicationTasks" 23 GetBuildRequest = "GetBuild" 24 GetDeploymentRequest = "GetDeployment" 25 GetDeploymentsRequest = "GetDeployments" 26 GetDropletRequest = "GetDroplet" 27 GetDropletsRequest = "GetDroplets" 28 GetIsolationSegmentOrganizationsRequest = "GetIsolationSegmentOrganizations" 29 GetIsolationSegmentRequest = "GetIsolationSegment" 30 GetIsolationSegmentsRequest = "GetIsolationSegments" 31 GetOrganizationRelationshipDefaultIsolationSegmentRequest = "GetOrganizationRelationshipDefaultIsolationSegment" 32 GetOrganizationsRequest = "GetOrganizations" 33 GetPackageRequest = "GetPackage" 34 GetPackagesRequest = "GetPackages" 35 GetProcessStatsRequest = "GetProcessStats" 36 GetServiceInstancesRequest = "GetServiceInstances" 37 GetSpaceRelationshipIsolationSegmentRequest = "GetSpaceRelationshipIsolationSegment" 38 GetSpacesRequest = "GetSpaces" 39 PatchApplicationCurrentDropletRequest = "PatchApplicationCurrentDroplet" 40 PatchApplicationEnvironmentVariablesRequest = "PatchApplicationEnvironmentVariables" 41 PatchApplicationRequest = "PatchApplication" 42 PatchOrganizationRelationshipDefaultIsolationSegmentRequest = "PatchOrganizationRelationshipDefaultIsolationSegment" 43 PatchProcessRequest = "PatchProcess" 44 PatchSpaceRelationshipIsolationSegmentRequest = "PatchSpaceRelationshipIsolationSegment" 45 PostApplicationActionApplyManifest = "PostApplicationActionApplyM" 46 PostApplicationActionRestartRequest = "PostApplicationActionRestart" 47 PostApplicationActionStartRequest = "PostApplicationActionStart" 48 PostApplicationActionStopRequest = "PostApplicationActionStop" 49 PostApplicationDeploymentActionCancelRequest = "PostApplicationDeploymentActionCancel" 50 PostApplicationDeploymentRequest = "PostApplicationDeployment" 51 PostApplicationProcessActionScaleRequest = "PostApplicationProcessActionScale" 52 PostApplicationRequest = "PostApplication" 53 PostApplicationTasksRequest = "PostApplicationTasks" 54 PostBuildRequest = "PostBuild" 55 PostIsolationSegmentRelationshipOrganizationsRequest = "PostIsolationSegmentRelationshipOrganizations" 56 PostIsolationSegmentsRequest = "PostIsolationSegments" 57 PostPackageRequest = "PostPackage" 58 PostServiceInstanceRelationshipsSharedSpacesRequest = "PostServiceInstanceRelationshipsSharedSpaces" 59 PutTaskCancelRequest = "PutTaskCancel" 60 ) 61 62 // APIRoutes is a list of routes used by the router to construct request URLs. 63 var APIRoutes = []Route{ 64 {Resource: AppsResource, Path: "/", Method: http.MethodGet, Name: GetApplicationsRequest}, 65 {Resource: AppsResource, Path: "/", Method: http.MethodPost, Name: PostApplicationRequest}, 66 {Resource: AppsResource, Path: "/:app_guid", Method: http.MethodDelete, Name: DeleteApplicationRequest}, 67 {Resource: AppsResource, Path: "/:app_guid", Method: http.MethodPatch, Name: PatchApplicationRequest}, 68 {Resource: AppsResource, Path: "/:app_guid/actions/apply_manifest", Method: http.MethodPost, Name: PostApplicationActionApplyManifest}, 69 {Resource: AppsResource, Path: "/:app_guid/actions/restart", Method: http.MethodPost, Name: PostApplicationActionRestartRequest}, 70 {Resource: AppsResource, Path: "/:app_guid/actions/start", Method: http.MethodPost, Name: PostApplicationActionStartRequest}, 71 {Resource: AppsResource, Path: "/:app_guid/actions/stop", Method: http.MethodPost, Name: PostApplicationActionStopRequest}, 72 {Resource: AppsResource, Path: "/:app_guid/droplets/current", Method: http.MethodGet, Name: GetApplicationDropletCurrentRequest}, 73 {Resource: AppsResource, Path: "/:app_guid/env", Method: http.MethodGet, Name: GetApplicationEnvRequest}, 74 {Resource: AppsResource, Path: "/:app_guid/environment_variables", Method: http.MethodPatch, Name: PatchApplicationEnvironmentVariablesRequest}, 75 {Resource: AppsResource, Path: "/:app_guid/processes", Method: http.MethodGet, Name: GetApplicationProcessesRequest}, 76 {Resource: AppsResource, Path: "/:app_guid/processes/:type", Method: http.MethodGet, Name: GetApplicationProcessRequest}, 77 {Resource: AppsResource, Path: "/:app_guid/processes/:type/actions/scale", Method: http.MethodPost, Name: PostApplicationProcessActionScaleRequest}, 78 {Resource: AppsResource, Path: "/:app_guid/processes/:type/instances/:index", Method: http.MethodDelete, Name: DeleteApplicationProcessInstanceRequest}, 79 {Resource: AppsResource, Path: "/:app_guid/relationships/current_droplet", Method: http.MethodPatch, Name: PatchApplicationCurrentDropletRequest}, 80 {Resource: AppsResource, Path: "/:app_guid/tasks", Method: http.MethodGet, Name: GetApplicationTasksRequest}, 81 {Resource: AppsResource, Path: "/:app_guid/tasks", Method: http.MethodPost, Name: PostApplicationTasksRequest}, 82 {Resource: BuildsResource, Path: "/", Method: http.MethodPost, Name: PostBuildRequest}, 83 {Resource: BuildsResource, Path: "/:build_guid", Method: http.MethodGet, Name: GetBuildRequest}, 84 {Resource: DeploymentsResource, Path: "/:deployment_guid", Method: http.MethodGet, Name: GetDeploymentRequest}, 85 {Resource: DeploymentsResource, Path: "/", Method: http.MethodPost, Name: PostApplicationDeploymentRequest}, 86 {Resource: DeploymentsResource, Path: "/", Method: http.MethodGet, Name: GetDeploymentsRequest}, 87 {Resource: DeploymentsResource, Path: "/:deployment_guid/actions/cancel", Method: http.MethodPost, Name: PostApplicationDeploymentActionCancelRequest}, 88 {Resource: DropletsResource, Path: "/", Method: http.MethodGet, Name: GetDropletsRequest}, 89 {Resource: DropletsResource, Path: "/:droplet_guid", Method: http.MethodGet, Name: GetDropletRequest}, 90 {Resource: IsolationSegmentsResource, Path: "/", Method: http.MethodGet, Name: GetIsolationSegmentsRequest}, 91 {Resource: IsolationSegmentsResource, Path: "/", Method: http.MethodPost, Name: PostIsolationSegmentsRequest}, 92 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid", Method: http.MethodDelete, Name: DeleteIsolationSegmentRequest}, 93 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid", Method: http.MethodGet, Name: GetIsolationSegmentRequest}, 94 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid/organizations", Method: http.MethodGet, Name: GetIsolationSegmentOrganizationsRequest}, 95 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid/relationships/organizations", Method: http.MethodPost, Name: PostIsolationSegmentRelationshipOrganizationsRequest}, 96 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid/relationships/organizations/:organization_guid", Method: http.MethodDelete, Name: DeleteIsolationSegmentRelationshipOrganizationRequest}, 97 {Resource: OrgsResource, Path: "/", Method: http.MethodGet, Name: GetOrganizationsRequest}, 98 {Resource: OrgsResource, Path: "/:organization_guid/relationships/default_isolation_segment", Method: http.MethodGet, Name: GetOrganizationRelationshipDefaultIsolationSegmentRequest}, 99 {Resource: OrgsResource, Path: "/:organization_guid/relationships/default_isolation_segment", Method: http.MethodPatch, Name: PatchOrganizationRelationshipDefaultIsolationSegmentRequest}, 100 {Resource: PackagesResource, Path: "/", Method: http.MethodGet, Name: GetPackagesRequest}, 101 {Resource: PackagesResource, Path: "/", Method: http.MethodPost, Name: PostPackageRequest}, 102 {Resource: PackagesResource, Path: "/:package_guid", Method: http.MethodGet, Name: GetPackageRequest}, 103 {Resource: ProcessesResource, Path: "/:process_guid", Method: http.MethodPatch, Name: PatchProcessRequest}, 104 {Resource: ProcessesResource, Path: "/:process_guid/stats", Method: http.MethodGet, Name: GetProcessStatsRequest}, 105 {Resource: ServiceInstancesResource, Path: "/", Method: http.MethodGet, Name: GetServiceInstancesRequest}, 106 {Resource: ServiceInstancesResource, Path: "/:service_instance_guid/relationships/shared_spaces", Method: http.MethodPost, Name: PostServiceInstanceRelationshipsSharedSpacesRequest}, 107 {Resource: ServiceInstancesResource, Path: "/:service_instance_guid/relationships/shared_spaces/:space_guid", Method: http.MethodDelete, Name: DeleteServiceInstanceRelationshipsSharedSpaceRequest}, 108 {Resource: SpacesResource, Path: "/", Method: http.MethodGet, Name: GetSpacesRequest}, 109 {Resource: SpacesResource, Path: "/:space_guid/relationships/isolation_segment", Method: http.MethodGet, Name: GetSpaceRelationshipIsolationSegmentRequest}, 110 {Resource: SpacesResource, Path: "/:space_guid/relationships/isolation_segment", Method: http.MethodPatch, Name: PatchSpaceRelationshipIsolationSegmentRequest}, 111 {Resource: TasksResource, Path: "/:task_guid/cancel", Method: http.MethodPut, Name: PutTaskCancelRequest}, 112 }