github.com/jenspinney/cli@v6.42.1-0.20190207184520-7450c600020e+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 DeleteBuildpackRequest = "DeleteBuildpack" 15 DeleteIsolationSegmentRelationshipOrganizationRequest = "DeleteIsolationSegmentRelationshipOrganization" 16 DeleteIsolationSegmentRequest = "DeleteIsolationSegment" 17 DeleteServiceInstanceRelationshipsSharedSpaceRequest = "DeleteServiceInstanceRelationshipsSharedSpace" 18 GetApplicationDropletCurrentRequest = "GetApplicationDropletCurrent" 19 GetApplicationEnvRequest = "GetApplicationEnv" 20 GetApplicationManifestRequest = "GetApplicationManifest" 21 GetApplicationProcessesRequest = "GetApplicationProcesses" 22 GetApplicationProcessRequest = "GetApplicationProcess" 23 GetApplicationsRequest = "GetApplications" 24 GetApplicationTasksRequest = "GetApplicationTasks" 25 GetBuildpacksRequest = "GetBuildpacks" 26 GetBuildRequest = "GetBuild" 27 GetDeploymentRequest = "GetDeployment" 28 GetDeploymentsRequest = "GetDeployments" 29 GetDropletRequest = "GetDroplet" 30 GetDropletsRequest = "GetDroplets" 31 GetIsolationSegmentOrganizationsRequest = "GetIsolationSegmentOrganizations" 32 GetIsolationSegmentRequest = "GetIsolationSegment" 33 GetIsolationSegmentsRequest = "GetIsolationSegments" 34 GetOrganizationRelationshipDefaultIsolationSegmentRequest = "GetOrganizationRelationshipDefaultIsolationSegment" 35 GetOrganizationsRequest = "GetOrganizations" 36 GetPackageRequest = "GetPackage" 37 GetPackagesRequest = "GetPackages" 38 GetProcessStatsRequest = "GetProcessStats" 39 GetServiceInstancesRequest = "GetServiceInstances" 40 GetSpaceRelationshipIsolationSegmentRequest = "GetSpaceRelationshipIsolationSegment" 41 GetSpacesRequest = "GetSpaces" 42 GetStacksRequest = "GetStacks" 43 PatchApplicationCurrentDropletRequest = "PatchApplicationCurrentDroplet" 44 PatchApplicationEnvironmentVariablesRequest = "PatchApplicationEnvironmentVariables" 45 PatchApplicationRequest = "PatchApplication" 46 PatchBuildpackRequest = "PatchBuildpack" 47 PatchOrganizationRelationshipDefaultIsolationSegmentRequest = "PatchOrganizationRelationshipDefaultIsolationSegment" 48 PatchProcessRequest = "PatchProcess" 49 PatchSpaceRelationshipIsolationSegmentRequest = "PatchSpaceRelationshipIsolationSegment" 50 PostApplicationActionApplyManifest = "PostApplicationActionApplyM" 51 PostApplicationActionRestartRequest = "PostApplicationActionRestart" 52 PostApplicationActionStartRequest = "PostApplicationActionStart" 53 PostApplicationActionStopRequest = "PostApplicationActionStop" 54 PostApplicationDeploymentActionCancelRequest = "PostApplicationDeploymentActionCancel" 55 PostApplicationDeploymentRequest = "PostApplicationDeployment" 56 PostApplicationProcessActionScaleRequest = "PostApplicationProcessActionScale" 57 PostApplicationRequest = "PostApplication" 58 PostApplicationTasksRequest = "PostApplicationTasks" 59 PostBuildRequest = "PostBuild" 60 PostBuildpackBitsRequest = "PostBuildpackBits" 61 PostBuildpackRequest = "PostBuildpack" 62 PostIsolationSegmentRelationshipOrganizationsRequest = "PostIsolationSegmentRelationshipOrganizations" 63 PostIsolationSegmentsRequest = "PostIsolationSegments" 64 PostPackageRequest = "PostPackage" 65 PostServiceInstanceRelationshipsSharedSpacesRequest = "PostServiceInstanceRelationshipsSharedSpaces" 66 PutTaskCancelRequest = "PutTaskCancel" 67 ) 68 69 // APIRoutes is a list of routes used by the router to construct request URLs. 70 var APIRoutes = []Route{ 71 {Resource: AppsResource, Path: "/", Method: http.MethodGet, Name: GetApplicationsRequest}, 72 {Resource: AppsResource, Path: "/", Method: http.MethodPost, Name: PostApplicationRequest}, 73 {Resource: AppsResource, Path: "/:app_guid", Method: http.MethodDelete, Name: DeleteApplicationRequest}, 74 {Resource: AppsResource, Path: "/:app_guid", Method: http.MethodPatch, Name: PatchApplicationRequest}, 75 {Resource: AppsResource, Path: "/:app_guid/actions/apply_manifest", Method: http.MethodPost, Name: PostApplicationActionApplyManifest}, 76 {Resource: AppsResource, Path: "/:app_guid/actions/restart", Method: http.MethodPost, Name: PostApplicationActionRestartRequest}, 77 {Resource: AppsResource, Path: "/:app_guid/actions/start", Method: http.MethodPost, Name: PostApplicationActionStartRequest}, 78 {Resource: AppsResource, Path: "/:app_guid/actions/stop", Method: http.MethodPost, Name: PostApplicationActionStopRequest}, 79 {Resource: AppsResource, Path: "/:app_guid/droplets/current", Method: http.MethodGet, Name: GetApplicationDropletCurrentRequest}, 80 {Resource: AppsResource, Path: "/:app_guid/env", Method: http.MethodGet, Name: GetApplicationEnvRequest}, 81 {Resource: AppsResource, Path: "/:app_guid/environment_variables", Method: http.MethodPatch, Name: PatchApplicationEnvironmentVariablesRequest}, 82 {Resource: AppsResource, Path: "/:app_guid/manifest", Method: http.MethodGet, Name: GetApplicationManifestRequest}, 83 {Resource: AppsResource, Path: "/:app_guid/processes", Method: http.MethodGet, Name: GetApplicationProcessesRequest}, 84 {Resource: AppsResource, Path: "/:app_guid/processes/:type", Method: http.MethodGet, Name: GetApplicationProcessRequest}, 85 {Resource: AppsResource, Path: "/:app_guid/processes/:type/actions/scale", Method: http.MethodPost, Name: PostApplicationProcessActionScaleRequest}, 86 {Resource: AppsResource, Path: "/:app_guid/processes/:type/instances/:index", Method: http.MethodDelete, Name: DeleteApplicationProcessInstanceRequest}, 87 {Resource: AppsResource, Path: "/:app_guid/relationships/current_droplet", Method: http.MethodPatch, Name: PatchApplicationCurrentDropletRequest}, 88 {Resource: AppsResource, Path: "/:app_guid/tasks", Method: http.MethodGet, Name: GetApplicationTasksRequest}, 89 {Resource: AppsResource, Path: "/:app_guid/tasks", Method: http.MethodPost, Name: PostApplicationTasksRequest}, 90 {Resource: BuildpacksResource, Path: "/", Method: http.MethodGet, Name: GetBuildpacksRequest}, 91 {Resource: BuildpacksResource, Path: "/", Method: http.MethodPost, Name: PostBuildpackRequest}, 92 {Resource: BuildpacksResource, Path: "/:buildpack_guid", Method: http.MethodPatch, Name: PatchBuildpackRequest}, 93 {Resource: BuildpacksResource, Path: "/:buildpack_guid/upload", Method: http.MethodPost, Name: PostBuildpackBitsRequest}, 94 {Resource: BuildpacksResource, Path: "/:buildpack_guid", Method: http.MethodDelete, Name: DeleteBuildpackRequest}, 95 {Resource: BuildsResource, Path: "/", Method: http.MethodPost, Name: PostBuildRequest}, 96 {Resource: BuildsResource, Path: "/:build_guid", Method: http.MethodGet, Name: GetBuildRequest}, 97 {Resource: DeploymentsResource, Path: "/", Method: http.MethodGet, Name: GetDeploymentsRequest}, 98 {Resource: DeploymentsResource, Path: "/", Method: http.MethodPost, Name: PostApplicationDeploymentRequest}, 99 {Resource: DeploymentsResource, Path: "/:deployment_guid", Method: http.MethodGet, Name: GetDeploymentRequest}, 100 {Resource: DeploymentsResource, Path: "/:deployment_guid/actions/cancel", Method: http.MethodPost, Name: PostApplicationDeploymentActionCancelRequest}, 101 {Resource: DropletsResource, Path: "/", Method: http.MethodGet, Name: GetDropletsRequest}, 102 {Resource: DropletsResource, Path: "/:droplet_guid", Method: http.MethodGet, Name: GetDropletRequest}, 103 {Resource: IsolationSegmentsResource, Path: "/", Method: http.MethodGet, Name: GetIsolationSegmentsRequest}, 104 {Resource: IsolationSegmentsResource, Path: "/", Method: http.MethodPost, Name: PostIsolationSegmentsRequest}, 105 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid", Method: http.MethodDelete, Name: DeleteIsolationSegmentRequest}, 106 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid", Method: http.MethodGet, Name: GetIsolationSegmentRequest}, 107 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid/organizations", Method: http.MethodGet, Name: GetIsolationSegmentOrganizationsRequest}, 108 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid/relationships/organizations", Method: http.MethodPost, Name: PostIsolationSegmentRelationshipOrganizationsRequest}, 109 {Resource: IsolationSegmentsResource, Path: "/:isolation_segment_guid/relationships/organizations/:organization_guid", Method: http.MethodDelete, Name: DeleteIsolationSegmentRelationshipOrganizationRequest}, 110 {Resource: OrgsResource, Path: "/", Method: http.MethodGet, Name: GetOrganizationsRequest}, 111 {Resource: OrgsResource, Path: "/:organization_guid/relationships/default_isolation_segment", Method: http.MethodGet, Name: GetOrganizationRelationshipDefaultIsolationSegmentRequest}, 112 {Resource: OrgsResource, Path: "/:organization_guid/relationships/default_isolation_segment", Method: http.MethodPatch, Name: PatchOrganizationRelationshipDefaultIsolationSegmentRequest}, 113 {Resource: PackagesResource, Path: "/", Method: http.MethodGet, Name: GetPackagesRequest}, 114 {Resource: PackagesResource, Path: "/", Method: http.MethodPost, Name: PostPackageRequest}, 115 {Resource: PackagesResource, Path: "/:package_guid", Method: http.MethodGet, Name: GetPackageRequest}, 116 {Resource: ProcessesResource, Path: "/:process_guid", Method: http.MethodPatch, Name: PatchProcessRequest}, 117 {Resource: ProcessesResource, Path: "/:process_guid/stats", Method: http.MethodGet, Name: GetProcessStatsRequest}, 118 {Resource: ServiceInstancesResource, Path: "/", Method: http.MethodGet, Name: GetServiceInstancesRequest}, 119 {Resource: ServiceInstancesResource, Path: "/:service_instance_guid/relationships/shared_spaces", Method: http.MethodPost, Name: PostServiceInstanceRelationshipsSharedSpacesRequest}, 120 {Resource: ServiceInstancesResource, Path: "/:service_instance_guid/relationships/shared_spaces/:space_guid", Method: http.MethodDelete, Name: DeleteServiceInstanceRelationshipsSharedSpaceRequest}, 121 {Resource: SpacesResource, Path: "/", Method: http.MethodGet, Name: GetSpacesRequest}, 122 {Resource: SpacesResource, Path: "/:space_guid/relationships/isolation_segment", Method: http.MethodGet, Name: GetSpaceRelationshipIsolationSegmentRequest}, 123 {Resource: SpacesResource, Path: "/:space_guid/relationships/isolation_segment", Method: http.MethodPatch, Name: PatchSpaceRelationshipIsolationSegmentRequest}, 124 {Resource: StacksResource, Path: "/", Method: http.MethodGet, Name: GetStacksRequest}, 125 {Resource: TasksResource, Path: "/:task_guid/cancel", Method: http.MethodPut, Name: PutTaskCancelRequest}, 126 }