Skip to content

Commit f5d685f

Browse files
issue-1168 adding interface and model for CreateOrganizationQuotaDefinition
1 parent 53d7a32 commit f5d685f

File tree

11 files changed

+493
-0
lines changed

11 files changed

+493
-0
lines changed

cloudfoundry-client/src/main/java/org/cloudfoundry/client/CloudFoundryClient.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import org.cloudfoundry.client.v3.droplets.Droplets;
5858
import org.cloudfoundry.client.v3.isolationsegments.IsolationSegments;
5959
import org.cloudfoundry.client.v3.jobs.JobsV3;
60+
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
6061
import org.cloudfoundry.client.v3.organizations.OrganizationsV3;
6162
import org.cloudfoundry.client.v3.packages.Packages;
6263
import org.cloudfoundry.client.v3.processes.Processes;
@@ -188,6 +189,11 @@ public interface CloudFoundryClient {
188189
*/
189190
OrganizationQuotaDefinitions organizationQuotaDefinitions();
190191

192+
/**
193+
* Main entry point to the Cloud Foundry Quota Definitions V3 Client API
194+
*/
195+
OrganizationQuotaDefinitionsV3 organizationQuotaDefinitionsV3();
196+
191197
/**
192198
* Main entry point to the Cloud Foundry Organizations V2 Client API
193199
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import org.cloudfoundry.Nullable;
21+
import org.cloudfoundry.client.v3.Resource;
22+
23+
/**
24+
* Base class for responses that are organization quota definitions
25+
*/
26+
public abstract class OrganizationQuotaDefinition extends Resource {
27+
28+
/**
29+
* Name of the quota
30+
*/
31+
@JsonProperty("name")
32+
abstract String getName();
33+
34+
/**
35+
* Quotas that affect applications and application sub-resources
36+
*/
37+
@JsonProperty("apps")
38+
@Nullable
39+
abstract Apps getApps();
40+
41+
/**
42+
* Quotas that affect services
43+
*/
44+
@JsonProperty("services")
45+
@Nullable
46+
abstract Services getServices();
47+
48+
/**
49+
* Quotas that affect routes
50+
*/
51+
@JsonProperty("routes")
52+
@Nullable
53+
abstract Routes getRoutes();
54+
55+
/**
56+
* Quotas that affect domains
57+
*/
58+
@JsonProperty("domains")
59+
@Nullable
60+
abstract Domains getDomains();
61+
62+
/**
63+
* A relationship to the organizations where the quota is applied
64+
*/
65+
@JsonProperty("relationships")
66+
@Nullable
67+
abstract OrganizationQuotaDefinitionRelationships getRelationships();
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import reactor.core.publisher.Mono;
20+
21+
/**
22+
* Main entry point to the Cloud Foundry Organization Quota Definitions Client API
23+
*/
24+
public interface OrganizationQuotaDefinitionsV3 {
25+
26+
/**
27+
* Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.200.0/index.html#create-organization-quota-definition">Create Organization Quota Definition</a>
28+
* request
29+
*
30+
* @param request the Create Organization Quota Definition request
31+
* @return the response from the Create Organization Quota Definition request
32+
*/
33+
Mono<CreateOrganizationQuotaDefinitionResponse> create(
34+
CreateOrganizationQuotaDefinitionRequest request);
35+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
21+
import org.cloudfoundry.Nullable;
22+
import org.immutables.value.Value;
23+
24+
/**
25+
* Quotas that affect applications and application sub-resources
26+
*/
27+
@JsonDeserialize
28+
@Value.Immutable
29+
abstract class _Apps {
30+
31+
/**
32+
* Maximum memory for a single process or task
33+
*/
34+
@JsonProperty("per_process_memory_in_mb")
35+
@Nullable
36+
abstract Integer getPerProcessMemoryInMb();
37+
38+
/**
39+
* Total memory allowed for all the started processes and running tasks in an organization
40+
*/
41+
@JsonProperty("total_memory_in_mb")
42+
@Nullable
43+
abstract Integer getTotalMemoryInMb();
44+
45+
/**
46+
* Total instances of all the started processes allowed in an organization
47+
*/
48+
@JsonProperty("total_instances")
49+
@Nullable
50+
abstract Integer getTotalInstances();
51+
52+
/**
53+
* Total log rate limit allowed for all the started processes and running tasks in an organization
54+
*/
55+
@JsonProperty("log_rate_limit_in_bytes_per_second")
56+
@Nullable
57+
abstract Integer getLogRateLimitInBytesPerSecond();
58+
59+
/**
60+
* Maximum number of running tasks in an organization
61+
*/
62+
@JsonProperty("per_app_tasks")
63+
@Nullable
64+
abstract Integer getPerAppTasks();
65+
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
21+
import org.cloudfoundry.Nullable;
22+
import org.immutables.value.Value;
23+
24+
/**
25+
* The request payload to creates a new organization quota
26+
*/
27+
@JsonSerialize
28+
@Value.Immutable
29+
abstract class _CreateOrganizationQuotaDefinitionRequest {
30+
31+
/**
32+
* Name of the quota
33+
*/
34+
@JsonProperty("name")
35+
abstract String getName();
36+
37+
/**
38+
* Quotas that affect applications and application sub-resources
39+
*/
40+
@JsonProperty("apps")
41+
@Nullable
42+
abstract Apps getApps();
43+
44+
/**
45+
* Quotas that affect services
46+
*/
47+
@JsonProperty("services")
48+
@Nullable
49+
abstract Services getServices();
50+
51+
/**
52+
* Quotas that affect routes
53+
*/
54+
@JsonProperty("routes")
55+
@Nullable
56+
abstract Routes getRoutes();
57+
58+
/**
59+
* Quotas that affect domains
60+
*/
61+
@JsonProperty("domains")
62+
@Nullable
63+
abstract Domains getDomains();
64+
65+
/**
66+
* A relationship to the organizations where the quota is applied
67+
*/
68+
@JsonProperty("relationships")
69+
@Nullable
70+
abstract OrganizationQuotaDefinitionRelationships getRelationships();
71+
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
20+
import org.immutables.value.Value;
21+
22+
/**
23+
* The response payload for the Create an Organization Quota Definition operation
24+
*/
25+
@JsonDeserialize
26+
@Value.Immutable
27+
abstract class _CreateOrganizationQuotaDefinitionResponse extends OrganizationQuotaDefinition {
28+
29+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
21+
import org.cloudfoundry.Nullable;
22+
import org.immutables.value.Value;
23+
24+
/**
25+
* Quotas that affect domains
26+
*/
27+
@JsonDeserialize
28+
@Value.Immutable
29+
abstract class _Domains {
30+
31+
/**
32+
* Total number of domains that can be scoped to an organization
33+
*
34+
* @return the total number of domains that can be scoped to an organization
35+
*/
36+
@JsonProperty("total_domains")
37+
@Nullable
38+
abstract Integer getTotalDomains();
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
21+
import org.cloudfoundry.Nullable;
22+
import org.cloudfoundry.client.v3.ToManyRelationship;
23+
import org.immutables.value.Value;
24+
25+
/**
26+
* The relationships for the OrganizationQuotaDefinition entity
27+
*/
28+
29+
@Value.Immutable
30+
@JsonDeserialize
31+
abstract class _OrganizationQuotaDefinitionRelationships {
32+
33+
/**
34+
* The quota relationship
35+
*/
36+
@JsonProperty("organizations")
37+
@Nullable
38+
abstract ToManyRelationship getOrganizations();
39+
40+
}

0 commit comments

Comments
 (0)