Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR sdk/kubernetesconfiguration/mgmt-v2019_11_01_preview] Dev kubernetesconfiguration microsoft.kubernetes configuration 2019 11 01 preview #10518

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.3.0</version>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-kubernetesconfiguration</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ public interface Operations extends HasInner<OperationsInner> {
/**
* List all the available operations the KubernetesConfiguration resource provider supports.
*
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ResourceProviderOperation> listAsync(final String apiVersion);
Observable<ResourceProviderOperation> listAsync();

}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public interface SourceControlConfiguration extends HasInner<SourceControlConfig
/**
* The entirety of the SourceControlConfiguration definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithClusterResourceName, DefinitionStages.WithClusterName, DefinitionStages.WithApiVersion, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithClusterResourceName, DefinitionStages.WithClusterName, DefinitionStages.WithCreate {
}

/**
Expand Down Expand Up @@ -141,19 +141,7 @@ interface WithClusterName {
* @param clusterName The name of the kubernetes cluster
* @return the next definition stage
*/
WithApiVersion withClusterName(String clusterName);
}

/**
* The stage of the sourcecontrolconfiguration definition allowing to specify ApiVersion.
*/
interface WithApiVersion {
/**
* Specifies apiVersion.
* @param apiVersion The API version to be used with the HTTP request
* @return the next definition stage
*/
WithCreate withApiVersion(String apiVersion);
WithCreate withClusterName(String clusterName);
}

/**
Expand Down Expand Up @@ -263,25 +251,13 @@ interface WithCreate extends Creatable<SourceControlConfiguration>, DefinitionSt
/**
* The template for a SourceControlConfiguration update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<SourceControlConfiguration>, UpdateStages.WithApiVersion, UpdateStages.WithEnableHelmOperator, UpdateStages.WithHelmOperatorProperties, UpdateStages.WithOperatorInstanceName, UpdateStages.WithOperatorNamespace, UpdateStages.WithOperatorParams, UpdateStages.WithOperatorScope, UpdateStages.WithOperatorType, UpdateStages.WithRepositoryUrl {
interface Update extends Appliable<SourceControlConfiguration>, UpdateStages.WithEnableHelmOperator, UpdateStages.WithHelmOperatorProperties, UpdateStages.WithOperatorInstanceName, UpdateStages.WithOperatorNamespace, UpdateStages.WithOperatorParams, UpdateStages.WithOperatorScope, UpdateStages.WithOperatorType, UpdateStages.WithRepositoryUrl {
}

/**
* Grouping of SourceControlConfiguration update stages.
*/
interface UpdateStages {
/**
* The stage of the sourcecontrolconfiguration update allowing to specify ApiVersion.
*/
interface WithApiVersion {
/**
* Specifies apiVersion.
* @param apiVersion The API version to be used with the HTTP request
* @return the next update stage
*/
Update withApiVersion(String apiVersion);
}

/**
* The stage of the sourcecontrolconfiguration update allowing to specify EnableHelmOperator.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ public interface SourceControlConfigurations extends SupportsCreating<SourceCont
* @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters'
* @param clusterName The name of the kubernetes cluster.
* @param sourceControlConfigurationName Name of the Source Control Configuration.
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<SourceControlConfiguration> getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, String apiVersion);
Observable<SourceControlConfiguration> getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName);

/**
* This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo.
Expand All @@ -40,11 +39,10 @@ public interface SourceControlConfigurations extends SupportsCreating<SourceCont
* @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters'
* @param clusterName The name of the kubernetes cluster.
* @param sourceControlConfigurationName Name of the Source Control Configuration.
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Completable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, String apiVersion);
Completable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName);

/**
* List all Source Control Configurations.
Expand All @@ -53,10 +51,9 @@ public interface SourceControlConfigurations extends SupportsCreating<SourceCont
* @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes'
* @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters'
* @param clusterName The name of the kubernetes cluster.
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<SourceControlConfiguration> listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName, final String apiVersion);
Observable<SourceControlConfiguration> listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public KubernetesConfigurationManager manager() {
}

@Override
public Observable<ResourceProviderOperation> listAsync(final String apiVersion) {
public Observable<ResourceProviderOperation> listAsync() {
OperationsInner client = this.inner();
return client.listAsync(apiVersion)
return client.listAsync()
.flatMapIterable(new Func1<Page<ResourceProviderOperationInner>, Iterable<ResourceProviderOperationInner>>() {
@Override
public Iterable<ResourceProviderOperationInner> call(Page<ResourceProviderOperationInner> page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ interface OperationsService {
/**
* List all the available operations the KubernetesConfiguration resource provider supports.
*
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList&lt;ResourceProviderOperationInner&gt; object if successful.
*/
public PagedList<ResourceProviderOperationInner> list(final String apiVersion) {
ServiceResponse<Page<ResourceProviderOperationInner>> response = listSinglePageAsync(apiVersion).toBlocking().single();
public PagedList<ResourceProviderOperationInner> list() {
ServiceResponse<Page<ResourceProviderOperationInner>> response = listSinglePageAsync().toBlocking().single();
return new PagedList<ResourceProviderOperationInner>(response.body()) {
@Override
public Page<ResourceProviderOperationInner> nextPage(String nextPageLink) {
Expand All @@ -87,14 +86,13 @@ public Page<ResourceProviderOperationInner> nextPage(String nextPageLink) {
/**
* List all the available operations the KubernetesConfiguration resource provider supports.
*
* @param apiVersion The API version to be used with the HTTP request.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<ResourceProviderOperationInner>> listAsync(final String apiVersion, final ListOperationCallback<ResourceProviderOperationInner> serviceCallback) {
public ServiceFuture<List<ResourceProviderOperationInner>> listAsync(final ListOperationCallback<ResourceProviderOperationInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(apiVersion),
listSinglePageAsync(),
new Func1<String, Observable<ServiceResponse<Page<ResourceProviderOperationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> call(String nextPageLink) {
Expand All @@ -107,12 +105,11 @@ public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> call(St
/**
* List all the available operations the KubernetesConfiguration resource provider supports.
*
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList&lt;ResourceProviderOperationInner&gt; object
*/
public Observable<Page<ResourceProviderOperationInner>> listAsync(final String apiVersion) {
return listWithServiceResponseAsync(apiVersion)
public Observable<Page<ResourceProviderOperationInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<ResourceProviderOperationInner>>, Page<ResourceProviderOperationInner>>() {
@Override
public Page<ResourceProviderOperationInner> call(ServiceResponse<Page<ResourceProviderOperationInner>> response) {
Expand All @@ -124,12 +121,11 @@ public Page<ResourceProviderOperationInner> call(ServiceResponse<Page<ResourcePr
/**
* List all the available operations the KubernetesConfiguration resource provider supports.
*
* @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList&lt;ResourceProviderOperationInner&gt; object
*/
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> listWithServiceResponseAsync(final String apiVersion) {
return listSinglePageAsync(apiVersion)
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> listWithServiceResponseAsync() {
return listSinglePageAsync()
.concatMap(new Func1<ServiceResponse<Page<ResourceProviderOperationInner>>, Observable<ServiceResponse<Page<ResourceProviderOperationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> call(ServiceResponse<Page<ResourceProviderOperationInner>> page) {
Expand All @@ -145,15 +141,14 @@ public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> call(Se
/**
* List all the available operations the KubernetesConfiguration resource provider supports.
*
ServiceResponse<PageImpl<ResourceProviderOperationInner>> * @param apiVersion The API version to be used with the HTTP request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList&lt;ResourceProviderOperationInner&gt; object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> listSinglePageAsync(final String apiVersion) {
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> listSinglePageAsync() {
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent())
return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceProviderOperationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceProviderOperationInner>>> call(Response<ResponseBody> response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ public SourceControlConfigurationClientImpl withSubscriptionId(String subscripti
return this;
}

/** The API version to be used with the HTTP request. */
private String apiVersion;

/**
* Gets The API version to be used with the HTTP request.
*
* @return the apiVersion value.
*/
public String apiVersion() {
return this.apiVersion;
}

/** The preferred language for the response. */
private String acceptLanguage;

Expand Down Expand Up @@ -177,6 +189,7 @@ public SourceControlConfigurationClientImpl(RestClient restClient) {
}

protected void initialize() {
this.apiVersion = "2019-11-01-preview";
this.acceptLanguage = "en-US";
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class SourceControlConfigurationImpl extends CreatableUpdatableImpl<SourceContro
private String clusterResourceName;
private String clusterName;
private String sourceControlConfigurationName;
private String capiVersion;
private String uapiVersion;

SourceControlConfigurationImpl(String name, KubernetesConfigurationManager manager) {
super(name, new SourceControlConfigurationInner());
Expand All @@ -43,9 +41,9 @@ class SourceControlConfigurationImpl extends CreatableUpdatableImpl<SourceContro
this.sourceControlConfigurationName = inner.name();
// set resource ancestor and positional variables
this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups");
this.clusterRp = IdParsingUtils.getValueFromIdByName(inner.id(), "providers");
this.clusterRp = String.fromString(IdParsingUtils.getValueFromIdByName(inner.id(), "providers"));
this.sourceControlConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "sourceControlConfigurations");
this.clusterResourceName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 6);
this.clusterResourceName = String.fromString(IdParsingUtils.getValueFromIdByPosition(inner.id(), 6));
this.clusterName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 7);
//
}
Expand All @@ -58,14 +56,14 @@ public KubernetesConfigurationManager manager() {
@Override
public Observable<SourceControlConfiguration> createResourceAsync() {
SourceControlConfigurationsInner client = this.manager().inner().sourceControlConfigurations();
return client.createOrUpdateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.sourceControlConfigurationName, this.capiVersion, this.inner())
return client.createOrUpdateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.sourceControlConfigurationName, this.inner())
.map(innerToFluentMap(this));
}

@Override
public Observable<SourceControlConfiguration> updateResourceAsync() {
SourceControlConfigurationsInner client = this.manager().inner().sourceControlConfigurations();
return client.createOrUpdateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.sourceControlConfigurationName, this.uapiVersion, this.inner())
return client.createOrUpdateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.sourceControlConfigurationName, this.inner())
.map(innerToFluentMap(this));
}

Expand Down Expand Up @@ -170,16 +168,6 @@ public SourceControlConfigurationImpl withClusterName(String clusterName) {
return this;
}

@Override
public SourceControlConfigurationImpl withApiVersion(String apiVersion) {
if (isInCreateMode()) {
this.capiVersion = apiVersion;
} else {
this.uapiVersion = apiVersion;
}
return this;
}

@Override
public SourceControlConfigurationImpl withEnableHelmOperator(EnableHelmOperator enableHelmOperator) {
this.inner().withEnableHelmOperator(enableHelmOperator);
Expand Down
Loading