Skip to content

Commit

Permalink
feat: Update Dapr to 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Aug 8, 2021
1 parent cbe6cc4 commit be2051a
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Chaos Mesh is chaos engineering platform that orchestrates chaos on Kubernetes e
](https://javadoc.io/doc/com.marcnuri.yakc.apis/dapr)

[Retrofit](https://square.github.io/retrofit/) API client Java interfaces for
[Dapr](https://dapr.io/) - Distributed Application Runtime (1.0.1).
[Dapr](https://dapr.io/) - Distributed Application Runtime (1.3.0).

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.

Expand Down
3 changes: 2 additions & 1 deletion apis/dapr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ sourceSets.main.java.srcDirs = ['src/api/java', 'src/main/java', 'src/model/java
def templatesDirs = new File(rootProject.projectDir, "schema/templates")
def schemaDir = new File(projectDir, "schema")
def availableSchemaNames = Arrays.asList(
"dapr-1.0.1.json"
"dapr-1.0.1.json",
"dapr-1.3.0.json"
)
def availableSchemas = availableSchemaNames.stream()
.map { s -> new File(schemaDir, s) }
Expand Down
1 change: 1 addition & 0 deletions apis/dapr/schema/dapr-1.3.0.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import com.marcnuri.yakc.model.io.dapr.v1alpha1.ConfigurationList;
import com.marcnuri.yakc.model.io.dapr.v1alpha1.Subscription;
import com.marcnuri.yakc.model.io.dapr.v1alpha1.SubscriptionList;
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions;
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status;
import java.util.HashMap;
import retrofit2.http.Body;
import retrofit2.http.HTTP;
Expand Down Expand Up @@ -262,7 +260,7 @@ public ListConfigurationForAllNamespaces watch(Boolean watch) {
@Headers({
"Accept: */*"
})
KubernetesCall<Status> deleteCollectionNamespacedComponent(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteCollectionNamespacedComponent(
@Path("namespace") String namespace);

/**
Expand All @@ -277,7 +275,7 @@ KubernetesCall<Status> deleteCollectionNamespacedComponent(
@Headers({
"Accept: */*"
})
KubernetesCall<Status> deleteCollectionNamespacedComponent(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteCollectionNamespacedComponent(
@Path("namespace") String namespace,
@QueryMap DeleteCollectionNamespacedComponent queryParameters);

Expand Down Expand Up @@ -554,10 +552,10 @@ public CreateNamespacedComponent fieldManager(String fieldManager) {
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedComponent(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedComponent(
@Path("name") String name,
@Path("namespace") String namespace,
@Body DeleteOptions body);
@Body com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions body);

/**
* delete a Component
Expand All @@ -574,7 +572,7 @@ KubernetesCall<Status> deleteNamespacedComponent(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedComponent(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedComponent(
@Path("name") String name,
@Path("namespace") String namespace);

Expand All @@ -593,10 +591,10 @@ KubernetesCall<Status> deleteNamespacedComponent(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedComponent(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedComponent(
@Path("name") String name,
@Path("namespace") String namespace,
@Body DeleteOptions body,
@Body com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions body,
@QueryMap DeleteNamespacedComponent queryParameters);

/**
Expand All @@ -614,7 +612,7 @@ KubernetesCall<Status> deleteNamespacedComponent(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedComponent(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedComponent(
@Path("name") String name,
@Path("namespace") String namespace,
@QueryMap DeleteNamespacedComponent queryParameters);
Expand Down Expand Up @@ -860,7 +858,7 @@ public ReplaceNamespacedComponent fieldManager(String fieldManager) {
@Headers({
"Accept: */*"
})
KubernetesCall<Status> deleteCollectionNamespacedConfiguration(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteCollectionNamespacedConfiguration(
@Path("namespace") String namespace);

/**
Expand All @@ -875,7 +873,7 @@ KubernetesCall<Status> deleteCollectionNamespacedConfiguration(
@Headers({
"Accept: */*"
})
KubernetesCall<Status> deleteCollectionNamespacedConfiguration(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteCollectionNamespacedConfiguration(
@Path("namespace") String namespace,
@QueryMap DeleteCollectionNamespacedConfiguration queryParameters);

Expand Down Expand Up @@ -1152,10 +1150,10 @@ public CreateNamespacedConfiguration fieldManager(String fieldManager) {
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedConfiguration(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedConfiguration(
@Path("name") String name,
@Path("namespace") String namespace,
@Body DeleteOptions body);
@Body com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions body);

/**
* delete a Configuration
Expand All @@ -1172,7 +1170,7 @@ KubernetesCall<Status> deleteNamespacedConfiguration(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedConfiguration(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedConfiguration(
@Path("name") String name,
@Path("namespace") String namespace);

Expand All @@ -1191,10 +1189,10 @@ KubernetesCall<Status> deleteNamespacedConfiguration(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedConfiguration(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedConfiguration(
@Path("name") String name,
@Path("namespace") String namespace,
@Body DeleteOptions body,
@Body com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions body,
@QueryMap DeleteNamespacedConfiguration queryParameters);

/**
Expand All @@ -1212,7 +1210,7 @@ KubernetesCall<Status> deleteNamespacedConfiguration(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedConfiguration(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedConfiguration(
@Path("name") String name,
@Path("namespace") String namespace,
@QueryMap DeleteNamespacedConfiguration queryParameters);
Expand Down Expand Up @@ -1458,7 +1456,7 @@ public ReplaceNamespacedConfiguration fieldManager(String fieldManager) {
@Headers({
"Accept: */*"
})
KubernetesCall<Status> deleteCollectionNamespacedSubscription(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteCollectionNamespacedSubscription(
@Path("namespace") String namespace);

/**
Expand All @@ -1473,7 +1471,7 @@ KubernetesCall<Status> deleteCollectionNamespacedSubscription(
@Headers({
"Accept: */*"
})
KubernetesCall<Status> deleteCollectionNamespacedSubscription(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteCollectionNamespacedSubscription(
@Path("namespace") String namespace,
@QueryMap DeleteCollectionNamespacedSubscription queryParameters);

Expand Down Expand Up @@ -1750,10 +1748,10 @@ public CreateNamespacedSubscription fieldManager(String fieldManager) {
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedSubscription(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedSubscription(
@Path("name") String name,
@Path("namespace") String namespace,
@Body DeleteOptions body);
@Body com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions body);

/**
* delete a Subscription
Expand All @@ -1770,7 +1768,7 @@ KubernetesCall<Status> deleteNamespacedSubscription(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedSubscription(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedSubscription(
@Path("name") String name,
@Path("namespace") String namespace);

Expand All @@ -1789,10 +1787,10 @@ KubernetesCall<Status> deleteNamespacedSubscription(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedSubscription(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedSubscription(
@Path("name") String name,
@Path("namespace") String namespace,
@Body DeleteOptions body,
@Body com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions body,
@QueryMap DeleteNamespacedSubscription queryParameters);

/**
Expand All @@ -1810,7 +1808,7 @@ KubernetesCall<Status> deleteNamespacedSubscription(
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<Status> deleteNamespacedSubscription(
KubernetesCall<com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status> deleteNamespacedSubscription(
@Path("name") String name,
@Path("namespace") String namespace,
@QueryMap DeleteNamespacedSubscription queryParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Singular;
import lombok.ToString;

/**
Expand All @@ -39,6 +41,13 @@ public class ConfigurationSpec implements Model {
@JsonProperty("accessControl")
private ConfigurationSpecAccessControl accessControl;

@JsonProperty("api")
private ConfigurationSpecApi api;

@JsonProperty("features")
@Singular(value = "addToFeatures", ignoreNullCollections = true)
private List<ConfigurationSpecFeatures> features;

@JsonProperty("httpPipeline")
private ConfigurationSpecHttpPipeline httpPipeline;

Expand All @@ -48,6 +57,9 @@ public class ConfigurationSpec implements Model {
@JsonProperty("mtls")
private ConfigurationSpecMtls mtls;

@JsonProperty("nameResolution")
private ConfigurationSpecNameResolution nameResolution;

@JsonProperty("secrets")
private ConfigurationSpecSecrets secrets;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v1alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Singular;
import lombok.ToString;

/**
* APISpec describes the configuration for Dapr APIs
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class ConfigurationSpecApi implements Model {


@JsonProperty("allowed")
@Singular(value = "addToAllowed", ignoreNullCollections = true)
private List<ConfigurationSpecApiAllowed> allowed;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v1alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;

/**
* APIAccessRule describes an access rule for allowing a Dapr API to be enabled and accessible by an app
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class ConfigurationSpecApiAllowed implements Model {


@NonNull
@JsonProperty("name")
private String name;

@JsonProperty("protocol")
private String protocol;

@NonNull
@JsonProperty("version")
private String version;

}

Loading

0 comments on commit be2051a

Please sign in to comment.