github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/actor/v7action/cloud_controller_client.go (about) 1 package v7action 2 3 import ( 4 "io" 5 6 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3" 7 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant" 8 "code.cloudfoundry.org/cli/resources" 9 ) 10 11 //go:generate counterfeiter . CloudControllerClient 12 13 // CloudControllerClient is the interface to the cloud controller V3 API. 14 type CloudControllerClient interface { 15 ApplyOrganizationQuota(quotaGUID string, orgGUID string) (resources.RelationshipList, ccv3.Warnings, error) 16 ApplySpaceQuota(quotaGUID string, spaceGUID string) (resources.RelationshipList, ccv3.Warnings, error) 17 AppSSHEndpoint() string 18 AppSSHHostKeyFingerprint() string 19 CheckRoute(domainGUID string, hostname string, path string, port int) (bool, ccv3.Warnings, error) 20 CloudControllerAPIVersion() string 21 CancelDeployment(deploymentGUID string) (ccv3.Warnings, error) 22 CopyPackage(sourcePackageGUID string, targetAppGUID string) (ccv3.Package, ccv3.Warnings, error) 23 CreateApplication(app resources.Application) (resources.Application, ccv3.Warnings, error) 24 CreateApplicationDeployment(appGUID string, dropletGUID string) (string, ccv3.Warnings, error) 25 CreateApplicationDeploymentByRevision(appGUID string, revisionGUID string) (string, ccv3.Warnings, error) 26 CreateApplicationProcessScale(appGUID string, process ccv3.Process) (ccv3.Process, ccv3.Warnings, error) 27 CreateApplicationTask(appGUID string, task ccv3.Task) (ccv3.Task, ccv3.Warnings, error) 28 CreateBuild(build ccv3.Build) (ccv3.Build, ccv3.Warnings, error) 29 CreateBuildpack(bp ccv3.Buildpack) (ccv3.Buildpack, ccv3.Warnings, error) 30 CreateDomain(domain resources.Domain) (resources.Domain, ccv3.Warnings, error) 31 CreateDroplet(appGUID string) (resources.Droplet, ccv3.Warnings, error) 32 CreateIsolationSegment(isolationSegment ccv3.IsolationSegment) (ccv3.IsolationSegment, ccv3.Warnings, error) 33 CreateOrganization(orgName string) (resources.Organization, ccv3.Warnings, error) 34 CreateOrganizationQuota(orgQuota resources.OrganizationQuota) (resources.OrganizationQuota, ccv3.Warnings, error) 35 CreatePackage(pkg ccv3.Package) (ccv3.Package, ccv3.Warnings, error) 36 CreateRole(role resources.Role) (resources.Role, ccv3.Warnings, error) 37 CreateRoute(route resources.Route) (resources.Route, ccv3.Warnings, error) 38 CreateServiceBroker(serviceBroker resources.ServiceBroker) (ccv3.JobURL, ccv3.Warnings, error) 39 CreateSecurityGroup(securityGroup resources.SecurityGroup) (resources.SecurityGroup, ccv3.Warnings, error) 40 CreateSpace(space resources.Space) (resources.Space, ccv3.Warnings, error) 41 CreateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, ccv3.Warnings, error) 42 CreateUser(userGUID string) (resources.User, ccv3.Warnings, error) 43 DeleteApplication(guid string) (ccv3.JobURL, ccv3.Warnings, error) 44 DeleteApplicationProcessInstance(appGUID string, processType string, instanceIndex int) (ccv3.Warnings, error) 45 DeleteBuildpack(buildpackGUID string) (ccv3.JobURL, ccv3.Warnings, error) 46 DeleteDomain(domainGUID string) (ccv3.JobURL, ccv3.Warnings, error) 47 DeleteIsolationSegment(guid string) (ccv3.Warnings, error) 48 DeleteIsolationSegmentOrganization(isolationSegmentGUID string, organizationGUID string) (ccv3.Warnings, error) 49 DeleteOrganization(orgGUID string) (ccv3.JobURL, ccv3.Warnings, error) 50 DeleteOrganizationQuota(quotaGUID string) (ccv3.JobURL, ccv3.Warnings, error) 51 DeleteOrphanedRoutes(spaceGUID string) (ccv3.JobURL, ccv3.Warnings, error) 52 DeleteRole(roleGUID string) (ccv3.JobURL, ccv3.Warnings, error) 53 DeleteRoute(routeGUID string) (ccv3.JobURL, ccv3.Warnings, error) 54 DeleteSecurityGroup(securityGroupGUID string) (ccv3.JobURL, ccv3.Warnings, error) 55 DeleteServiceBroker(serviceBrokerGUID string) (ccv3.JobURL, ccv3.Warnings, error) 56 DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, sharedToSpaceGUID string) (ccv3.Warnings, error) 57 DeleteSpaceQuota(spaceQuotaGUID string) (ccv3.JobURL, ccv3.Warnings, error) 58 DeleteSpace(guid string) (ccv3.JobURL, ccv3.Warnings, error) 59 DeleteUser(userGUID string) (ccv3.JobURL, ccv3.Warnings, error) 60 DownloadDroplet(dropletGUID string) ([]byte, ccv3.Warnings, error) 61 EntitleIsolationSegmentToOrganizations(isoGUID string, orgGUIDs []string) (resources.RelationshipList, ccv3.Warnings, error) 62 GetApplicationByNameAndSpace(appName string, spaceGUID string) (resources.Application, ccv3.Warnings, error) 63 GetApplicationDropletCurrent(appGUID string) (resources.Droplet, ccv3.Warnings, error) 64 GetApplicationEnvironment(appGUID string) (ccv3.Environment, ccv3.Warnings, error) 65 GetApplicationManifest(appGUID string) ([]byte, ccv3.Warnings, error) 66 GetApplicationProcessByType(appGUID string, processType string) (ccv3.Process, ccv3.Warnings, error) 67 GetApplicationProcesses(appGUID string) ([]ccv3.Process, ccv3.Warnings, error) 68 GetApplicationRevisions(appGUID string, query ...ccv3.Query) ([]resources.Revision, ccv3.Warnings, error) 69 GetApplicationRoutes(appGUID string) ([]resources.Route, ccv3.Warnings, error) 70 GetApplicationTasks(appGUID string, query ...ccv3.Query) ([]ccv3.Task, ccv3.Warnings, error) 71 GetApplications(query ...ccv3.Query) ([]resources.Application, ccv3.Warnings, error) 72 GetBuild(guid string) (ccv3.Build, ccv3.Warnings, error) 73 GetBuildpacks(query ...ccv3.Query) ([]ccv3.Buildpack, ccv3.Warnings, error) 74 GetDefaultDomain(orgGuid string) (resources.Domain, ccv3.Warnings, error) 75 GetDeployment(guid string) (ccv3.Deployment, ccv3.Warnings, error) 76 GetDeployments(query ...ccv3.Query) ([]ccv3.Deployment, ccv3.Warnings, error) 77 GetDomain(GUID string) (resources.Domain, ccv3.Warnings, error) 78 GetDomains(query ...ccv3.Query) ([]resources.Domain, ccv3.Warnings, error) 79 GetDroplet(guid string) (resources.Droplet, ccv3.Warnings, error) 80 GetDroplets(query ...ccv3.Query) ([]resources.Droplet, ccv3.Warnings, error) 81 GetEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName) (ccv3.EnvironmentVariables, ccv3.Warnings, error) 82 GetEvents(query ...ccv3.Query) ([]ccv3.Event, ccv3.Warnings, error) 83 GetFeatureFlag(featureFlagName string) (ccv3.FeatureFlag, ccv3.Warnings, error) 84 GetFeatureFlags() ([]ccv3.FeatureFlag, ccv3.Warnings, error) 85 GetInfo() (ccv3.Info, ccv3.ResourceLinks, ccv3.Warnings, error) 86 GetIsolationSegment(guid string) (ccv3.IsolationSegment, ccv3.Warnings, error) 87 GetIsolationSegmentOrganizations(isolationSegmentGUID string) ([]resources.Organization, ccv3.Warnings, error) 88 GetIsolationSegments(query ...ccv3.Query) ([]ccv3.IsolationSegment, ccv3.Warnings, error) 89 GetNewApplicationProcesses(appGUID string, deploymentGUID string) ([]ccv3.Process, ccv3.Warnings, error) 90 GetOrganization(orgGUID string) (resources.Organization, ccv3.Warnings, error) 91 GetOrganizationDefaultIsolationSegment(orgGUID string) (resources.Relationship, ccv3.Warnings, error) 92 GetOrganizationDomains(orgGUID string, query ...ccv3.Query) ([]resources.Domain, ccv3.Warnings, error) 93 GetOrganizationQuota(quotaGUID string) (resources.OrganizationQuota, ccv3.Warnings, error) 94 GetOrganizationQuotas(query ...ccv3.Query) ([]resources.OrganizationQuota, ccv3.Warnings, error) 95 GetOrganizations(query ...ccv3.Query) ([]resources.Organization, ccv3.Warnings, error) 96 GetPackage(guid string) (ccv3.Package, ccv3.Warnings, error) 97 GetPackages(query ...ccv3.Query) ([]ccv3.Package, ccv3.Warnings, error) 98 GetPackageDroplets(packageGUID string, query ...ccv3.Query) ([]resources.Droplet, ccv3.Warnings, error) 99 GetProcess(processGUID string) (ccv3.Process, ccv3.Warnings, error) 100 GetProcesses(query ...ccv3.Query) ([]ccv3.Process, ccv3.Warnings, error) 101 GetProcessInstances(processGUID string) ([]ccv3.ProcessInstance, ccv3.Warnings, error) 102 GetProcessSidecars(processGUID string) ([]ccv3.Sidecar, ccv3.Warnings, error) 103 GetRoles(query ...ccv3.Query) ([]resources.Role, ccv3.IncludedResources, ccv3.Warnings, error) 104 RootResponse() (ccv3.Info, ccv3.Warnings, error) 105 GetRouteDestinations(routeGUID string) ([]resources.RouteDestination, ccv3.Warnings, error) 106 GetRoutes(query ...ccv3.Query) ([]resources.Route, ccv3.Warnings, error) 107 GetRunningSecurityGroups(spaceGUID string, queries ...ccv3.Query) ([]resources.SecurityGroup, ccv3.Warnings, error) 108 GetSecurityGroups(query ...ccv3.Query) ([]resources.SecurityGroup, ccv3.Warnings, error) 109 GetServiceBrokers(query ...ccv3.Query) ([]resources.ServiceBroker, ccv3.Warnings, error) 110 GetServiceInstances(query ...ccv3.Query) ([]resources.ServiceInstance, ccv3.Warnings, error) 111 GetServiceOfferings(query ...ccv3.Query) ([]resources.ServiceOffering, ccv3.Warnings, error) 112 GetServiceOfferingByNameAndBroker(serviceOfferingName, serviceBrokerName string) (resources.ServiceOffering, ccv3.Warnings, error) 113 GetServicePlans(query ...ccv3.Query) ([]resources.ServicePlan, ccv3.Warnings, error) 114 GetServicePlansWithOfferings(query ...ccv3.Query) ([]ccv3.ServiceOfferingWithPlans, ccv3.Warnings, error) 115 GetServicePlansWithSpaceAndOrganization(query ...ccv3.Query) ([]ccv3.ServicePlanWithSpaceAndOrganization, ccv3.Warnings, error) 116 GetSpaceFeature(spaceGUID string, featureName string) (bool, ccv3.Warnings, error) 117 GetSpaceIsolationSegment(spaceGUID string) (resources.Relationship, ccv3.Warnings, error) 118 GetSpaceQuota(spaceQuotaGUID string) (resources.SpaceQuota, ccv3.Warnings, error) 119 GetSpaces(query ...ccv3.Query) ([]resources.Space, ccv3.IncludedResources, ccv3.Warnings, error) 120 GetSpaceQuotas(query ...ccv3.Query) ([]resources.SpaceQuota, ccv3.Warnings, error) 121 GetSSHEnabled(appGUID string) (ccv3.SSHEnabled, ccv3.Warnings, error) 122 GetAppFeature(appGUID string, featureName string) (resources.ApplicationFeature, ccv3.Warnings, error) 123 GetStacks(query ...ccv3.Query) ([]ccv3.Stack, ccv3.Warnings, error) 124 GetStagingSecurityGroups(spaceGUID string, queries ...ccv3.Query) ([]resources.SecurityGroup, ccv3.Warnings, error) 125 GetUser(userGUID string) (resources.User, ccv3.Warnings, error) 126 GetUsers(query ...ccv3.Query) ([]resources.User, ccv3.Warnings, error) 127 MapRoute(routeGUID string, appGUID string) (ccv3.Warnings, error) 128 PollJob(jobURL ccv3.JobURL) (ccv3.Warnings, error) 129 PurgeServiceOffering(serviceOfferingGUID string) (ccv3.Warnings, error) 130 ResourceMatch(resources []ccv3.Resource) ([]ccv3.Resource, ccv3.Warnings, error) 131 SetApplicationDroplet(appGUID string, dropletGUID string) (resources.Relationship, ccv3.Warnings, error) 132 SharePrivateDomainToOrgs(domainGuid string, sharedOrgs ccv3.SharedOrgs) (ccv3.Warnings, error) 133 ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (resources.RelationshipList, ccv3.Warnings, error) 134 TargetCF(settings ccv3.TargetSettings) (ccv3.Info, ccv3.Warnings, error) 135 UnbindSecurityGroupRunningSpace(securityGroupGUID string, spaceGUID string) (ccv3.Warnings, error) 136 UnbindSecurityGroupStagingSpace(securityGroupGUID string, spaceGUID string) (ccv3.Warnings, error) 137 UnmapRoute(routeGUID string, destinationGUID string) (ccv3.Warnings, error) 138 UnsharePrivateDomainFromOrg(domainGUID string, sharedOrgGUID string) (ccv3.Warnings, error) 139 UpdateAppFeature(appGUID string, enabled bool, featureName string) (ccv3.Warnings, error) 140 UpdateApplication(app resources.Application) (resources.Application, ccv3.Warnings, error) 141 UpdateApplicationApplyManifest(appGUID string, rawManifest []byte) (ccv3.JobURL, ccv3.Warnings, error) 142 UpdateApplicationEnvironmentVariables(appGUID string, envVars ccv3.EnvironmentVariables) (ccv3.EnvironmentVariables, ccv3.Warnings, error) 143 UpdateApplicationRestart(appGUID string) (resources.Application, ccv3.Warnings, error) 144 UpdateApplicationStart(appGUID string) (resources.Application, ccv3.Warnings, error) 145 UpdateApplicationStop(appGUID string) (resources.Application, ccv3.Warnings, error) 146 UpdateBuildpack(buildpack ccv3.Buildpack) (ccv3.Buildpack, ccv3.Warnings, error) 147 UpdateEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName, envVars ccv3.EnvironmentVariables) (ccv3.EnvironmentVariables, ccv3.Warnings, error) 148 UpdateFeatureFlag(flag ccv3.FeatureFlag) (ccv3.FeatureFlag, ccv3.Warnings, error) 149 UpdateOrganization(org resources.Organization) (resources.Organization, ccv3.Warnings, error) 150 UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID string, isolationSegmentGUID string) (resources.Relationship, ccv3.Warnings, error) 151 UpdateOrganizationQuota(orgQuota resources.OrganizationQuota) (resources.OrganizationQuota, ccv3.Warnings, error) 152 UpdateProcess(process ccv3.Process) (ccv3.Process, ccv3.Warnings, error) 153 UpdateResourceMetadata(resource string, resourceGUID string, metadata resources.Metadata) (ccv3.JobURL, ccv3.Warnings, error) 154 UpdateSecurityGroupRunningSpace(securityGroupGUID string, spaceGUIDs []string) (ccv3.Warnings, error) 155 UpdateSecurityGroupStagingSpace(securityGroupGUID string, spaceGUIDs []string) (ccv3.Warnings, error) 156 UpdateSecurityGroup(securityGroup resources.SecurityGroup) (resources.SecurityGroup, ccv3.Warnings, error) 157 UpdateSpace(space resources.Space) (resources.Space, ccv3.Warnings, error) 158 UpdateSpaceApplyManifest(spaceGUID string, rawManifest []byte) (ccv3.JobURL, ccv3.Warnings, error) 159 UpdateSpaceFeature(spaceGUID string, enabled bool, featureName string) (ccv3.Warnings, error) 160 UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (resources.Relationship, ccv3.Warnings, error) 161 UpdateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, ccv3.Warnings, error) 162 UnsetSpaceQuota(spaceQuotaGUID, spaceGUID string) (ccv3.Warnings, error) 163 UpdateServiceBroker(serviceBrokerGUID string, serviceBroker resources.ServiceBroker) (ccv3.JobURL, ccv3.Warnings, error) 164 UpdateTaskCancel(taskGUID string) (ccv3.Task, ccv3.Warnings, error) 165 UploadBitsPackage(pkg ccv3.Package, matchedResources []ccv3.Resource, newResources io.Reader, newResourcesLength int64) (ccv3.Package, ccv3.Warnings, error) 166 UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (ccv3.JobURL, ccv3.Warnings, error) 167 UploadDropletBits(dropletGUID string, dropletPath string, droplet io.Reader, dropletLength int64) (ccv3.JobURL, ccv3.Warnings, error) 168 UploadPackage(pkg ccv3.Package, zipFilepath string) (ccv3.Package, ccv3.Warnings, error) 169 170 servicePlanVisibilityClient 171 } 172 173 type servicePlanVisibilityClient interface { 174 GetServicePlanVisibility(servicePlanGUID string) (resources.ServicePlanVisibility, ccv3.Warnings, error) 175 UpdateServicePlanVisibility(servicePlanGUID string, visibility resources.ServicePlanVisibility) (resources.ServicePlanVisibility, ccv3.Warnings, error) 176 DeleteServicePlanVisibility(servicePlanGUID, organizationGUID string) (ccv3.Warnings, error) 177 } 178 179 // TODO: Split this enormous interface