Skip to content

Commit 6fa0c13

Browse files
committed
feat: Istio API
1 parent e9506fd commit 6fa0c13

File tree

176 files changed

+31070
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+31070
-5
lines changed

apis/istio/build.gradle

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import com.marcnuri.yack.schema.api.ApiGeneratorTask
2+
import com.marcnuri.yack.schema.model.ModelGeneratorTask
3+
4+
apply from: rootDir.toPath().resolve('shared.gradle').toFile()
5+
6+
ext {
7+
isPublishable = true
8+
project.group = project.group + ".apis"
9+
pomName = 'Istio Model & API'
10+
pomDescription = 'Retrofit2 based Java interfaces to create a declarative REST API client and model files for Istio.'
11+
}
12+
13+
dependencies {
14+
compile project(':kubernetes-model')
15+
compileOnly "org.projectlombok:lombok:$version_projectlombok"
16+
annotationProcessor "org.projectlombok:lombok:$version_projectlombok"
17+
}
18+
sourceSets.main.java.srcDirs = ['src/api/java', 'src/main/java', 'src/model/java']
19+
20+
21+
def templatesDirs = new File(rootProject.projectDir, "schema/templates")
22+
def schemaDir = new File(projectDir, "schema")
23+
def availableSchemaNames = Arrays.asList(
24+
"istio-1.7.4.json"
25+
)
26+
def availableSchemas = availableSchemaNames.stream()
27+
.map { s -> new File(schemaDir, s) }
28+
.toArray{ i -> new File[i]}
29+
task generateModel(type: ModelGeneratorTask) {
30+
group = 'generators'
31+
packageName = 'com.marcnuri.yakc'
32+
schemas = availableSchemas
33+
templatesDir = templatesDirs
34+
outputDirectory = projectDir
35+
skipGenerationRegexes = ['^io\\.k8s\\.apimachinery\\.pkg\\..*']
36+
}
37+
task generateApi(type: ApiGeneratorTask) {
38+
group = 'generators'
39+
packageName = 'com.marcnuri.yakc'
40+
schemas = availableSchemas
41+
templatesDir = templatesDirs
42+
outputDirectory = projectDir
43+
skipGenerationRegexes = ['^apis$', '^version$']
44+
}

apis/istio/schema/istio-1.7.4.json

+1
Large diffs are not rendered by default.

apis/istio/src/api/java/com/marcnuri/yakc/api/configistioio/v1alpha2/ConfigIstioIoV1alpha2Api.java

+6,993
Large diffs are not rendered by default.

apis/istio/src/api/java/com/marcnuri/yakc/api/networkingistioio/v1alpha3/NetworkingIstioIoV1alpha3Api.java

+6,123
Large diffs are not rendered by default.

apis/istio/src/api/java/com/marcnuri/yakc/api/networkingistioio/v1beta1/NetworkingIstioIoV1beta1Api.java

+5,253
Large diffs are not rendered by default.

apis/istio/src/api/java/com/marcnuri/yakc/api/securityistioio/v1beta1/SecurityIstioIoV1beta1Api.java

+2,643
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
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 com.marcnuri.yakc.model.io.istio.config.v1alpha2;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.ToString;
27+
28+
/**
29+
*
30+
*/
31+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
32+
@Builder(toBuilder = true, builderClassName = "Builder")
33+
@AllArgsConstructor
34+
@NoArgsConstructor
35+
@Data
36+
@ToString
37+
public class Attributemanifest implements Model {
38+
39+
40+
/**
41+
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
42+
*/
43+
@JsonProperty("apiVersion")
44+
private String apiVersion;
45+
46+
/**
47+
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
48+
*/
49+
@JsonProperty("kind")
50+
private String kind;
51+
52+
@JsonProperty("metadata")
53+
private ObjectMeta metadata;
54+
55+
@JsonProperty("spec")
56+
private AttributemanifestSpec spec;
57+
58+
@JsonProperty("status")
59+
private Object status;
60+
61+
}
62+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
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 com.marcnuri.yakc.model.io.istio.config.v1alpha2;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.ListModel;
21+
import com.marcnuri.yakc.model.Model;
22+
import java.util.List;
23+
import lombok.AllArgsConstructor;
24+
import lombok.Builder;
25+
import lombok.Data;
26+
import lombok.NoArgsConstructor;
27+
import lombok.NonNull;
28+
import lombok.Singular;
29+
import lombok.ToString;
30+
31+
/**
32+
* attributemanifestList is a list of attributemanifest
33+
*/
34+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
35+
@Builder(toBuilder = true, builderClassName = "Builder")
36+
@AllArgsConstructor
37+
@NoArgsConstructor
38+
@Data
39+
@ToString
40+
public class AttributemanifestList implements Model, ListModel<Attributemanifest> {
41+
42+
43+
/**
44+
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
45+
*/
46+
@JsonProperty("apiVersion")
47+
private String apiVersion;
48+
49+
/**
50+
* List of attributemanifests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
51+
*/
52+
@NonNull
53+
@JsonProperty("items")
54+
@Singular(value = "addToItems", ignoreNullCollections = true)
55+
private List<Attributemanifest> items;
56+
57+
/**
58+
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
59+
*/
60+
@JsonProperty("kind")
61+
private String kind;
62+
63+
@JsonProperty("metadata")
64+
private HTTPAPISpecBindingListMetadata metadata;
65+
66+
}
67+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
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 com.marcnuri.yakc.model.io.istio.config.v1alpha2;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import java.util.Map;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.Singular;
27+
import lombok.ToString;
28+
29+
/**
30+
* Describes the rules used to configure Mixer's policy and telemetry features. See more details at: https://istio.io/docs/reference/config/policy-and-telemetry/istio.policy.v1beta1.html
31+
*/
32+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
33+
@Builder(toBuilder = true, builderClassName = "Builder")
34+
@AllArgsConstructor
35+
@NoArgsConstructor
36+
@Data
37+
@ToString
38+
public class AttributemanifestSpec implements Model {
39+
40+
41+
/**
42+
* The set of attributes this Istio component will be responsible for producing at runtime.
43+
*/
44+
@JsonProperty("attributes")
45+
@Singular(value = "putInAttributes", ignoreNullCollections = true)
46+
private Map<String, AttributemanifestSpecAttributes> attributes;
47+
48+
/**
49+
* Name of the component producing these attributes.
50+
*/
51+
@JsonProperty("name")
52+
private String name;
53+
54+
/**
55+
* The revision of this document.
56+
*/
57+
@JsonProperty("revision")
58+
private String revision;
59+
60+
}
61+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
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 com.marcnuri.yakc.model.io.istio.config.v1alpha2;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import lombok.AllArgsConstructor;
22+
import lombok.Builder;
23+
import lombok.Data;
24+
import lombok.NoArgsConstructor;
25+
import lombok.ToString;
26+
27+
/**
28+
*
29+
*/
30+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
31+
@Builder(toBuilder = true, builderClassName = "Builder")
32+
@AllArgsConstructor
33+
@NoArgsConstructor
34+
@Data
35+
@ToString
36+
public class AttributemanifestSpecAttributes implements Model {
37+
38+
39+
/**
40+
* A human-readable description of the attribute's purpose.
41+
*/
42+
@JsonProperty("description")
43+
private String description;
44+
45+
/**
46+
* The type of data carried by this attribute.
47+
*/
48+
@JsonProperty("valueType")
49+
private String valueType;
50+
51+
}
52+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
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 com.marcnuri.yakc.model.io.istio.config.v1alpha2;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.ToString;
27+
28+
/**
29+
*
30+
*/
31+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
32+
@Builder(toBuilder = true, builderClassName = "Builder")
33+
@AllArgsConstructor
34+
@NoArgsConstructor
35+
@Data
36+
@ToString
37+
public class HTTPAPISpec implements Model {
38+
39+
40+
/**
41+
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
42+
*/
43+
@JsonProperty("apiVersion")
44+
private String apiVersion;
45+
46+
/**
47+
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
48+
*/
49+
@JsonProperty("kind")
50+
private String kind;
51+
52+
@JsonProperty("metadata")
53+
private ObjectMeta metadata;
54+
55+
@JsonProperty("spec")
56+
private HTTPAPISpecSpec spec;
57+
58+
@JsonProperty("status")
59+
private Object status;
60+
61+
}
62+

0 commit comments

Comments
 (0)