diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationDeltaHealthPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationDeltaHealthPolicy.java new file mode 100644 index 00000000000..1c54b32c179 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationDeltaHealthPolicy.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a delta health policy used to evaluate the health of an application + * or one of its child entities when upgrading the cluster. + */ +public class ApplicationDeltaHealthPolicy { + /** + * The delta health policy used by default to evaluate the health of a + * service type when upgrading the cluster. + */ + @JsonProperty(value = "defaultServiceTypeDeltaHealthPolicy") + private ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy; + + /** + * The map with service type delta health policy per service type name. The + * map is empty by default. + */ + @JsonProperty(value = "serviceTypeDeltaHealthPolicies") + private Map serviceTypeDeltaHealthPolicies; + + /** + * Get the defaultServiceTypeDeltaHealthPolicy value. + * + * @return the defaultServiceTypeDeltaHealthPolicy value + */ + public ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy() { + return this.defaultServiceTypeDeltaHealthPolicy; + } + + /** + * Set the defaultServiceTypeDeltaHealthPolicy value. + * + * @param defaultServiceTypeDeltaHealthPolicy the defaultServiceTypeDeltaHealthPolicy value to set + * @return the ApplicationDeltaHealthPolicy object itself. + */ + public ApplicationDeltaHealthPolicy withDefaultServiceTypeDeltaHealthPolicy(ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy) { + this.defaultServiceTypeDeltaHealthPolicy = defaultServiceTypeDeltaHealthPolicy; + return this; + } + + /** + * Get the serviceTypeDeltaHealthPolicies value. + * + * @return the serviceTypeDeltaHealthPolicies value + */ + public Map serviceTypeDeltaHealthPolicies() { + return this.serviceTypeDeltaHealthPolicies; + } + + /** + * Set the serviceTypeDeltaHealthPolicies value. + * + * @param serviceTypeDeltaHealthPolicies the serviceTypeDeltaHealthPolicies value to set + * @return the ApplicationDeltaHealthPolicy object itself. + */ + public ApplicationDeltaHealthPolicy withServiceTypeDeltaHealthPolicies(Map serviceTypeDeltaHealthPolicies) { + this.serviceTypeDeltaHealthPolicies = serviceTypeDeltaHealthPolicies; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationHealthPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationHealthPolicy.java new file mode 100644 index 00000000000..61b02e9657d --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationHealthPolicy.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. + */ +public class ApplicationHealthPolicy { + /** + * The health policy used by default to evaluate the health of a service + * type. + */ + @JsonProperty(value = "defaultServiceTypeHealthPolicy") + private ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy; + + /** + * The map with service type health policy per service type name. The map + * is empty by default. + */ + @JsonProperty(value = "serviceTypeHealthPolicies") + private Map serviceTypeHealthPolicies; + + /** + * Indicates whether warnings are treated with the same severity as errors. + */ + @JsonProperty(value = "ConsiderWarningAsError") + private Boolean considerWarningAsError; + + /** + * The maximum allowed percentage of unhealthy deployed applications. + * Allowed values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered + * in error. + * This is calculated by dividing the number of unhealthy deployed + * applications over the number of nodes where the application is currently + * deployed on in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + */ + @JsonProperty(value = "MaxPercentUnhealthyDeployedApplications") + private Integer maxPercentUnhealthyDeployedApplications; + + /** + * The health policy used by default to evaluate the health of a service + * type. + */ + @JsonProperty(value = "DefaultServiceTypeHealthPolicy") + private ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy1; + + /** + * The map with service type health policy per service type name. The map + * is empty by default. + */ + @JsonProperty(value = "ServiceTypeHealthPolicyMap") + private Map serviceTypeHealthPolicyMap; + + /** + * Get the defaultServiceTypeHealthPolicy value. + * + * @return the defaultServiceTypeHealthPolicy value + */ + public ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy() { + return this.defaultServiceTypeHealthPolicy; + } + + /** + * Set the defaultServiceTypeHealthPolicy value. + * + * @param defaultServiceTypeHealthPolicy the defaultServiceTypeHealthPolicy value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withDefaultServiceTypeHealthPolicy(ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy) { + this.defaultServiceTypeHealthPolicy = defaultServiceTypeHealthPolicy; + return this; + } + + /** + * Get the serviceTypeHealthPolicies value. + * + * @return the serviceTypeHealthPolicies value + */ + public Map serviceTypeHealthPolicies() { + return this.serviceTypeHealthPolicies; + } + + /** + * Set the serviceTypeHealthPolicies value. + * + * @param serviceTypeHealthPolicies the serviceTypeHealthPolicies value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withServiceTypeHealthPolicies(Map serviceTypeHealthPolicies) { + this.serviceTypeHealthPolicies = serviceTypeHealthPolicies; + return this; + } + + /** + * Get the considerWarningAsError value. + * + * @return the considerWarningAsError value + */ + public Boolean considerWarningAsError() { + return this.considerWarningAsError; + } + + /** + * Set the considerWarningAsError value. + * + * @param considerWarningAsError the considerWarningAsError value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withConsiderWarningAsError(Boolean considerWarningAsError) { + this.considerWarningAsError = considerWarningAsError; + return this; + } + + /** + * Get the maxPercentUnhealthyDeployedApplications value. + * + * @return the maxPercentUnhealthyDeployedApplications value + */ + public Integer maxPercentUnhealthyDeployedApplications() { + return this.maxPercentUnhealthyDeployedApplications; + } + + /** + * Set the maxPercentUnhealthyDeployedApplications value. + * + * @param maxPercentUnhealthyDeployedApplications the maxPercentUnhealthyDeployedApplications value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withMaxPercentUnhealthyDeployedApplications(Integer maxPercentUnhealthyDeployedApplications) { + this.maxPercentUnhealthyDeployedApplications = maxPercentUnhealthyDeployedApplications; + return this; + } + + /** + * Get the defaultServiceTypeHealthPolicy1 value. + * + * @return the defaultServiceTypeHealthPolicy1 value + */ + public ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy1() { + return this.defaultServiceTypeHealthPolicy1; + } + + /** + * Set the defaultServiceTypeHealthPolicy1 value. + * + * @param defaultServiceTypeHealthPolicy1 the defaultServiceTypeHealthPolicy1 value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withDefaultServiceTypeHealthPolicy1(ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy1) { + this.defaultServiceTypeHealthPolicy1 = defaultServiceTypeHealthPolicy1; + return this; + } + + /** + * Get the serviceTypeHealthPolicyMap value. + * + * @return the serviceTypeHealthPolicyMap value + */ + public Map serviceTypeHealthPolicyMap() { + return this.serviceTypeHealthPolicyMap; + } + + /** + * Set the serviceTypeHealthPolicyMap value. + * + * @param serviceTypeHealthPolicyMap the serviceTypeHealthPolicyMap value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withServiceTypeHealthPolicyMap(Map serviceTypeHealthPolicyMap) { + this.serviceTypeHealthPolicyMap = serviceTypeHealthPolicyMap; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationMetricDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationMetricDescription.java new file mode 100644 index 00000000000..24075777c9f --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationMetricDescription.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes capacity information for a custom resource balancing metric. This + * can be used to limit the total consumption of this metric by the services of + * this application. + */ +public class ApplicationMetricDescription { + /** + * The name of the metric. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The maximum node capacity for Service Fabric application. + * This is the maximum Load for an instance of this application on a single + * node. Even if the capacity of node is greater than this value, Service + * Fabric will limit the total load of services within the application on + * each node to this value. + * If set to zero, capacity for this metric is unlimited on each node. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + * When updating existing application with application capacity, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + */ + @JsonProperty(value = "MaximumCapacity") + private Long maximumCapacity; + + /** + * The node reservation capacity for Service Fabric application. + * This is the amount of load which is reserved on nodes which have + * instances of this application. + * If MinimumNodes is specified, then the product of these values will be + * the capacity reserved in the cluster for the application. + * If set to zero, no capacity is reserved for this metric. + * When setting application capacity or when updating application capacity; + * this value must be smaller than or equal to MaximumCapacity for each + * metric. + */ + @JsonProperty(value = "ReservationCapacity") + private Long reservationCapacity; + + /** + * The total metric capacity for Service Fabric application. + * This is the total metric capacity for this application in the cluster. + * Service Fabric will try to limit the sum of loads of services within the + * application to this value. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and MaximumCapacity must always be smaller than + * or equal to this value. + */ + @JsonProperty(value = "TotalApplicationCapacity") + private Long totalApplicationCapacity; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the maximumCapacity value. + * + * @return the maximumCapacity value + */ + public Long maximumCapacity() { + return this.maximumCapacity; + } + + /** + * Set the maximumCapacity value. + * + * @param maximumCapacity the maximumCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withMaximumCapacity(Long maximumCapacity) { + this.maximumCapacity = maximumCapacity; + return this; + } + + /** + * Get the reservationCapacity value. + * + * @return the reservationCapacity value + */ + public Long reservationCapacity() { + return this.reservationCapacity; + } + + /** + * Set the reservationCapacity value. + * + * @param reservationCapacity the reservationCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withReservationCapacity(Long reservationCapacity) { + this.reservationCapacity = reservationCapacity; + return this; + } + + /** + * Get the totalApplicationCapacity value. + * + * @return the totalApplicationCapacity value + */ + public Long totalApplicationCapacity() { + return this.totalApplicationCapacity; + } + + /** + * Set the totalApplicationCapacity value. + * + * @param totalApplicationCapacity the totalApplicationCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withTotalApplicationCapacity(Long totalApplicationCapacity) { + this.totalApplicationCapacity = totalApplicationCapacity; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationUpgradePolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationUpgradePolicy.java new file mode 100644 index 00000000000..1687b026652 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ApplicationUpgradePolicy.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the policy for a monitored application upgrade. + */ +public class ApplicationUpgradePolicy { + /** + * The maximum amount of time to block processing of an upgrade domain and + * prevent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed + * regardless of availability loss issues. The timeout is reset at the + * start of each upgrade domain. Valid values are between 0 and 42949672925 + * inclusive. (unsigned 32-bit integer). + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout") + private Long upgradeReplicaSetCheckTimeout; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /** + * The policy used for monitoring the application upgrade. + */ + @JsonProperty(value = "rollingUpgradeMonitoringPolicy") + private RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy; + + /** + * Defines a health policy used to evaluate the health of an application or + * one of its children entities. + */ + @JsonProperty(value = "applicationHealthPolicy") + private ApplicationHealthPolicy applicationHealthPolicy; + + /** + * Get the upgradeReplicaSetCheckTimeout value. + * + * @return the upgradeReplicaSetCheckTimeout value + */ + public Long upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set the upgradeReplicaSetCheckTimeout value. + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withUpgradeReplicaSetCheckTimeout(Long upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the forceRestart value. + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set the forceRestart value. + * + * @param forceRestart the forceRestart value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get the rollingUpgradeMonitoringPolicy value. + * + * @return the rollingUpgradeMonitoringPolicy value + */ + public RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy() { + return this.rollingUpgradeMonitoringPolicy; + } + + /** + * Set the rollingUpgradeMonitoringPolicy value. + * + * @param rollingUpgradeMonitoringPolicy the rollingUpgradeMonitoringPolicy value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withRollingUpgradeMonitoringPolicy(RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy) { + this.rollingUpgradeMonitoringPolicy = rollingUpgradeMonitoringPolicy; + return this; + } + + /** + * Get the applicationHealthPolicy value. + * + * @return the applicationHealthPolicy value + */ + public ApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set the applicationHealthPolicy value. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withApplicationHealthPolicy(ApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/AvailableOperationDisplay.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/AvailableOperationDisplay.java index bd1065f833b..a5ef3e8dc9b 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/AvailableOperationDisplay.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/AvailableOperationDisplay.java @@ -11,23 +11,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Operation supported by ServiceFabric resource provider. + * Operation supported by Service Fabric resource provider. */ public class AvailableOperationDisplay { /** - * Provider name. + * The name of the provider. */ @JsonProperty(value = "provider") private String provider; /** - * Resource name. + * The resource on which the operation is performed. */ @JsonProperty(value = "resource") private String resource; /** - * Operation name. + * The operation that can be performed. */ @JsonProperty(value = "operation") private String operation; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/CertificateDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/CertificateDescription.java index fadcdb3e7c5..1574b34eef7 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/CertificateDescription.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/CertificateDescription.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Certificate details. + * Describes the certificate details. */ public class CertificateDescription { /** diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateCommonName.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateCommonName.java index f3982f922bc..16f3a3510ef 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateCommonName.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateCommonName.java @@ -11,25 +11,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Client certificate details using common name. + * Describes the client certificate details using common name. */ public class ClientCertificateCommonName { /** - * Is this certificate used for admin access from the client, if false , it - * is used or query only access. + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. */ @JsonProperty(value = "isAdmin", required = true) private boolean isAdmin; /** - * Certificate common name to be granted access; be carefull using wild - * card common names. + * The common name of the client certificate. */ @JsonProperty(value = "certificateCommonName", required = true) private String certificateCommonName; /** - * Certificate issuer thumbprint. + * The issuer thumbprint of the client certificate. */ @JsonProperty(value = "certificateIssuerThumbprint", required = true) private String certificateIssuerThumbprint; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateThumbprint.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateThumbprint.java index ce8ade65f21..9832cf6dff1 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateThumbprint.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClientCertificateThumbprint.java @@ -11,18 +11,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Client certificate details using thumbprint. + * Describes the client certificate details using thumbprint. */ public class ClientCertificateThumbprint { /** - * Is this certificate used for admin access from the client, if false, it - * is used or query only access. + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. */ @JsonProperty(value = "isAdmin", required = true) private boolean isAdmin; /** - * Certificate thumbprint. + * The thumbprint of the client certificate. */ @JsonProperty(value = "certificateThumbprint", required = true) private String certificateThumbprint; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterCodeVersionsResult.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterCodeVersionsResult.java new file mode 100644 index 00000000000..518db77e016 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterCodeVersionsResult.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The result of the ServiceFabric runtime versions. + */ +@JsonFlatten +public class ClusterCodeVersionsResult { + /** + * The identification of the result. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the result. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The result resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "properties.codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "properties.supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Indicates if this version is for Windows or Linux operating system. + * Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.environment") + private String environment; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withType(String type) { + this.type = type; + return this; + } + + /** + * Get the codeVersion value. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the codeVersion value. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the supportExpiryUtc value. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the supportExpiryUtc value. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get the environment value. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set the environment value. + * + * @param environment the environment value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterHealthPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterHealthPolicy.java index 33cfbb90f76..4e867600267 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterHealthPolicy.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterHealthPolicy.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.servicefabric; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -19,6 +20,18 @@ public class ClusterHealthPolicy { * The maximum allowed percentage of unhealthy nodes before reporting an * error. For example, to allow 10% of nodes to be unhealthy, this value * would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. */ @JsonProperty(value = "maxPercentUnhealthyNodes") private Integer maxPercentUnhealthyNodes; @@ -27,10 +40,29 @@ public class ClusterHealthPolicy { * The maximum allowed percentage of unhealthy applications before * reporting an error. For example, to allow 10% of applications to be * unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of + * applications that can be unhealthy before the cluster is considered in + * error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. */ @JsonProperty(value = "maxPercentUnhealthyApplications") private Integer maxPercentUnhealthyApplications; + /** + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "applicationHealthPolicies") + private Map applicationHealthPolicies; + /** * Get the maxPercentUnhealthyNodes value. * @@ -71,4 +103,24 @@ public ClusterHealthPolicy withMaxPercentUnhealthyApplications(Integer maxPercen return this; } + /** + * Get the applicationHealthPolicies value. + * + * @return the applicationHealthPolicies value + */ + public Map applicationHealthPolicies() { + return this.applicationHealthPolicies; + } + + /** + * Set the applicationHealthPolicies value. + * + * @param applicationHealthPolicies the applicationHealthPolicies value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withApplicationHealthPolicies(Map applicationHealthPolicies) { + this.applicationHealthPolicies = applicationHealthPolicies; + return this; + } + } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpdateParameters.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpdateParameters.java new file mode 100644 index 00000000000..6eeb959bcca --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpdateParameters.java @@ -0,0 +1,391 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Cluster update request. + */ +@JsonFlatten +public class ClusterUpdateParameters { + /** + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /** + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.certificateCommonNames") + private ServerCertificateCommonNames certificateCommonNames; + + /** + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * The list of custom fabric settings to configure the cluster. This will + * overwrite the existing list. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * The list of node types in the cluster. This will overwrite the existing + * list. + */ + @JsonProperty(value = "properties.nodeTypes") + private List nodeTypes; + + /** + * The reliability level sets the replica set size of system services. + * Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. + * This should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of + * 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', + * 'Platinum'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * The upgrade mode of the cluster when new Service Fabric runtime version + * is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * Cluster update parameters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the addOnFeatures value. + * + * @return the addOnFeatures value + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the addOnFeatures value. + * + * @param addOnFeatures the addOnFeatures value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + + /** + * Get the certificate value. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate value. + * + * @param certificate the certificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the certificateCommonNames value. + * + * @return the certificateCommonNames value + */ + public ServerCertificateCommonNames certificateCommonNames() { + return this.certificateCommonNames; + } + + /** + * Set the certificateCommonNames value. + * + * @param certificateCommonNames the certificateCommonNames value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + this.certificateCommonNames = certificateCommonNames; + return this; + } + + /** + * Get the clientCertificateCommonNames value. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the clientCertificateCommonNames value. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the clientCertificateThumbprints value. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the clientCertificateThumbprints value. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the clusterCodeVersion value. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the clusterCodeVersion value. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the fabricSettings value. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings value. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the nodeTypes value. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the nodeTypes value. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the reliabilityLevel value. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set the reliabilityLevel value. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get the reverseProxyCertificate value. + * + * @return the reverseProxyCertificate value + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the reverseProxyCertificate value. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the upgradeDescription value. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the upgradeDescription value. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the upgradeMode value. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode value. + * + * @param upgradeMode the upgradeMode value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeMode(String upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradeDeltaHealthPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradeDeltaHealthPolicy.java index c43b6c4c6dd..66f639e62d4 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradeDeltaHealthPolicy.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradeDeltaHealthPolicy.java @@ -8,30 +8,58 @@ package com.microsoft.azure.management.servicefabric; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** - * Delta health policy for the cluster. + * Describes the delta health policies for the cluster upgrade. */ public class ClusterUpgradeDeltaHealthPolicy { /** - * Additional unhealthy nodes percentage. + * The maximum allowed percentage of nodes health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. */ @JsonProperty(value = "maxPercentDeltaUnhealthyNodes", required = true) private int maxPercentDeltaUnhealthyNodes; /** - * Additional unhealthy nodes percentage per upgrade domain. + * The maximum allowed percentage of upgrade domain nodes health + * degradation allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at + * the beginning of upgrade and the state of the upgrade domain nodes at + * the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. */ @JsonProperty(value = "maxPercentUpgradeDomainDeltaUnhealthyNodes", required = true) private int maxPercentUpgradeDomainDeltaUnhealthyNodes; /** - * Additional unhealthy applications percentage. + * The maximum allowed percentage of applications health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of + * the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. */ @JsonProperty(value = "maxPercentDeltaUnhealthyApplications", required = true) private int maxPercentDeltaUnhealthyApplications; + /** + * Defines the application delta health policy map used to evaluate the + * health of an application or one of its child entities when upgrading the + * cluster. + */ + @JsonProperty(value = "applicationDeltaHealthPolicies") + private Map applicationDeltaHealthPolicies; + /** * Get the maxPercentDeltaUnhealthyNodes value. * @@ -92,4 +120,24 @@ public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyApplications( return this; } + /** + * Get the applicationDeltaHealthPolicies value. + * + * @return the applicationDeltaHealthPolicies value + */ + public Map applicationDeltaHealthPolicies() { + return this.applicationDeltaHealthPolicies; + } + + /** + * Set the applicationDeltaHealthPolicies value. + * + * @param applicationDeltaHealthPolicies the applicationDeltaHealthPolicies value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withApplicationDeltaHealthPolicies(Map applicationDeltaHealthPolicies) { + this.applicationDeltaHealthPolicies = applicationDeltaHealthPolicies; + return this; + } + } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradePolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradePolicy.java index f888484a937..b1dc990cd23 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradePolicy.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterUpgradePolicy.java @@ -11,92 +11,80 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Cluster upgrade policy. + * Describes the policy used when upgrading the cluster. */ public class ClusterUpgradePolicy { /** - * Use the user defined upgrade policy or not. - */ - @JsonProperty(value = "overrideUserUpgradePolicy") - private Boolean overrideUserUpgradePolicy; - - /** - * Force node to restart or not. + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). */ @JsonProperty(value = "forceRestart") private Boolean forceRestart; /** - * Timeout for replica set upgrade to complete,it represents .Net TimeSpan. + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed + * regardless of availability loss issues. The timeout is reset at the + * start of each upgrade domain. The timeout can be in either hh:mm:ss or + * in d.hh:mm:ss.ms format. */ @JsonProperty(value = "upgradeReplicaSetCheckTimeout", required = true) private String upgradeReplicaSetCheckTimeout; /** * The length of time to wait after completing an upgrade domain before - * performing health checks, it represents .Net TimeSpan. + * performing health checks. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. */ @JsonProperty(value = "healthCheckWaitDuration", required = true) private String healthCheckWaitDuration; /** - * The length of time that health checks must pass continuously,it - * represents .Net TimeSpan. + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. The duration can + * be in either hh:mm:ss or in d.hh:mm:ss.ms format. */ @JsonProperty(value = "healthCheckStableDuration", required = true) private String healthCheckStableDuration; /** - * The length of time that health checks can fail continuously,it - * represents .Net TimeSpan. + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before the upgrade rolls back. The timeout can be + * in either hh:mm:ss or in d.hh:mm:ss.ms format. */ @JsonProperty(value = "healthCheckRetryTimeout", required = true) private String healthCheckRetryTimeout; /** - * The upgrade timeout,it represents .Net TimeSpan. + * The amount of time the overall upgrade has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. */ @JsonProperty(value = "upgradeTimeout", required = true) private String upgradeTimeout; /** - * The timeout for any upgrade domain,it represents .Net TimeSpan. + * The amount of time each upgrade domain has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. */ @JsonProperty(value = "upgradeDomainTimeout", required = true) private String upgradeDomainTimeout; /** - * Cluster health Policy. + * The cluster health policy used when upgrading the cluster. */ @JsonProperty(value = "healthPolicy", required = true) private ClusterHealthPolicy healthPolicy; /** - * Delta health policy. + * The cluster delta health policy used when upgrading the cluster. */ @JsonProperty(value = "deltaHealthPolicy") private ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy; - /** - * Get the overrideUserUpgradePolicy value. - * - * @return the overrideUserUpgradePolicy value - */ - public Boolean overrideUserUpgradePolicy() { - return this.overrideUserUpgradePolicy; - } - - /** - * Set the overrideUserUpgradePolicy value. - * - * @param overrideUserUpgradePolicy the overrideUserUpgradePolicy value to set - * @return the ClusterUpgradePolicy object itself. - */ - public ClusterUpgradePolicy withOverrideUserUpgradePolicy(Boolean overrideUserUpgradePolicy) { - this.overrideUserUpgradePolicy = overrideUserUpgradePolicy; - return this; - } - /** * Get the forceRestart value. * diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterVersionDetails.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterVersionDetails.java index ac36c4b33b4..785b57c4952 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterVersionDetails.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ClusterVersionDetails.java @@ -11,11 +11,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The detail of the ServiceFabric runtime version result. + * The detail of the Service Fabric runtime version result. */ public class ClusterVersionDetails { /** - * The ServiceFabric runtime version of the cluster. + * The Service Fabric runtime version of the cluster. */ @JsonProperty(value = "codeVersion") private String codeVersion; @@ -27,7 +27,8 @@ public class ClusterVersionDetails { private String supportExpiryUtc; /** - * Cluster operating system. Possible values include: 'Windows', 'Linux'. + * Indicates if this version is for Windows or Linux operating system. + * Possible values include: 'Windows', 'Linux'. */ @JsonProperty(value = "environment") private String environment; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/DiagnosticsStorageAccountConfig.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/DiagnosticsStorageAccountConfig.java index 98f7d898429..0bd5e1a9a4f 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/DiagnosticsStorageAccountConfig.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/DiagnosticsStorageAccountConfig.java @@ -11,35 +11,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Diagnostics storage account config. + * The storage account information for storing Service Fabric diagnostic logs. */ public class DiagnosticsStorageAccountConfig { /** - * Diagnostics storage account name. + * The Azure storage account name. */ @JsonProperty(value = "storageAccountName", required = true) private String storageAccountName; /** - * Protected Diagnostics storage key name. + * The protected diagnostics storage key name. */ @JsonProperty(value = "protectedAccountKeyName", required = true) private String protectedAccountKeyName; /** - * Diagnostics storage account blob endpoint. + * The blob endpoint of the azure storage account. */ @JsonProperty(value = "blobEndpoint", required = true) private String blobEndpoint; /** - * Diagnostics storage account queue endpoint. + * The queue endpoint of the azure storage account. */ @JsonProperty(value = "queueEndpoint", required = true) private String queueEndpoint; /** - * Diagnostics storage account table endpoint. + * The table endpoint of the azure storage account. */ @JsonProperty(value = "tableEndpoint", required = true) private String tableEndpoint; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModel.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModel.java index 4fa8155880a..90fb1b51bc0 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModel.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModel.java @@ -15,7 +15,7 @@ */ public class ErrorModel { /** - * The error detail. + * The error details. */ @JsonProperty(value = "error") private ErrorModelError error; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModelError.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModelError.java index fcc4d7ed4d3..0aa71744fa6 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModelError.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ErrorModelError.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The error detail. + * The error details. */ public class ErrorModelError { /** diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/MoveCost.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/MoveCost.java new file mode 100644 index 00000000000..663c1214639 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/MoveCost.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MoveCost. + */ +public final class MoveCost extends ExpandableStringEnum { + /** Static value Zero for MoveCost. */ + public static final MoveCost ZERO = fromString("Zero"); + + /** Static value Low for MoveCost. */ + public static final MoveCost LOW = fromString("Low"); + + /** Static value Medium for MoveCost. */ + public static final MoveCost MEDIUM = fromString("Medium"); + + /** Static value High for MoveCost. */ + public static final MoveCost HIGH = fromString("High"); + + /** + * Creates or finds a MoveCost from its string representation. + * @param name a name to look for + * @return the corresponding MoveCost + */ + @JsonCreator + public static MoveCost fromString(String name) { + return fromString(name, MoveCost.class); + } + + /** + * @return known MoveCost values + */ + public static Collection values() { + return values(MoveCost.class); + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NamedPartitionSchemeDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NamedPartitionSchemeDescription.java new file mode 100644 index 00000000000..91d06a039e7 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NamedPartitionSchemeDescription.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the named partition scheme of the service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("Named") +public class NamedPartitionSchemeDescription extends PartitionSchemeDescription { + /** + * The number of partitions. + */ + @JsonProperty(value = "Count", required = true) + private int count; + + /** + * Array of size specified by the ‘Count’ parameter, for the names of the + * partitions. + */ + @JsonProperty(value = "Names", required = true) + private List names; + + /** + * Get the count value. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the names value. + * + * @return the names value + */ + public List names() { + return this.names; + } + + /** + * Set the names value. + * + * @param names the names value to set + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withNames(List names) { + this.names = names; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NodeTypeDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NodeTypeDescription.java index bc3e0137320..d5d5fe2a873 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NodeTypeDescription.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/NodeTypeDescription.java @@ -17,7 +17,7 @@ */ public class NodeTypeDescription { /** - * Name of the node type. + * The name of the node type. */ @JsonProperty(value = "name", required = true) private String name; @@ -31,8 +31,8 @@ public class NodeTypeDescription { /** * The capacity tags applied to the nodes in the node type, the cluster - * resource manager uses these tags to understand how much of a resource a - * node has. + * resource manager uses these tags to understand how much resource a node + * has. */ @JsonProperty(value = "capacities") private Map capacities; @@ -50,38 +50,51 @@ public class NodeTypeDescription { private int httpGatewayEndpointPort; /** - * Nodetype durability Level. Possible values include: 'Bronze', 'Silver', - * 'Gold'. + * The durability level of the node type. Learn about + * [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - Bronze - No privileges. This is the default. + * - Silver - The infrastructure jobs can be paused for a duration of 10 + * minutes per UD. + * - Gold - The infrastructure jobs can be paused for a duration of 2 hours + * per UD. Gold durability can be enabled only on full node VM skus like + * D15_V2, G5 etc. + * . Possible values include: 'Bronze', 'Silver', 'Gold'. */ @JsonProperty(value = "durabilityLevel") private String durabilityLevel; /** - * Ports used by applications. + * The range of ports from which cluster assigned port to Service Fabric + * applications. */ @JsonProperty(value = "applicationPorts") private EndpointRangeDescription applicationPorts; /** - * System assgined application ports. + * The range of empheral ports that nodes in this node type should be + * configured with. */ @JsonProperty(value = "ephemeralPorts") private EndpointRangeDescription ephemeralPorts; /** - * Mark this as the primary node type. + * The node type on which system services will run. Only one node type + * should be marked as primary. Primary node type cannot be deleted or + * changed for existing clusters. */ @JsonProperty(value = "isPrimary", required = true) private boolean isPrimary; /** - * The number of node instances in the node type. + * The number of nodes in the node type. This count should match the + * capacity property in the corresponding VirtualMachineScaleSet resource. */ @JsonProperty(value = "vmInstanceCount", required = true) private int vmInstanceCount; /** - * Endpoint used by reverse proxy. + * The endpoint used by reverse proxy. */ @JsonProperty(value = "reverseProxyEndpointPort") private Integer reverseProxyEndpointPort; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/PartitionScheme.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/PartitionScheme.java new file mode 100644 index 00000000000..8c783611b9b --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/PartitionScheme.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PartitionScheme. + */ +public final class PartitionScheme extends ExpandableStringEnum { + /** Static value Invalid for PartitionScheme. */ + public static final PartitionScheme INVALID = fromString("Invalid"); + + /** Static value Singleton for PartitionScheme. */ + public static final PartitionScheme SINGLETON = fromString("Singleton"); + + /** Static value UniformInt64Range for PartitionScheme. */ + public static final PartitionScheme UNIFORM_INT64RANGE = fromString("UniformInt64Range"); + + /** Static value Named for PartitionScheme. */ + public static final PartitionScheme NAMED = fromString("Named"); + + /** + * Creates or finds a PartitionScheme from its string representation. + * @param name a name to look for + * @return the corresponding PartitionScheme + */ + @JsonCreator + public static PartitionScheme fromString(String name) { + return fromString(name, PartitionScheme.class); + } + + /** + * @return known PartitionScheme values + */ + public static Collection values() { + return values(PartitionScheme.class); + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/PartitionSchemeDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/PartitionSchemeDescription.java new file mode 100644 index 00000000000..0355a7a8c3e --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/PartitionSchemeDescription.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes how the service is partitioned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("PartitionSchemeDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Named", value = NamedPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "Singleton", value = SingletonPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "UniformInt64Range", value = UniformInt64RangePartitionSchemeDescription.class) +}) +public class PartitionSchemeDescription { +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ProvisioningState.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ProvisioningState.java index b5a7380d358..dcda8b2168c 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ProvisioningState.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ProvisioningState.java @@ -8,58 +8,40 @@ package com.microsoft.azure.management.servicefabric; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for ProvisioningState. */ -public final class ProvisioningState { +public final class ProvisioningState extends ExpandableStringEnum { /** Static value Updating for ProvisioningState. */ - public static final ProvisioningState UPDATING = new ProvisioningState("Updating"); + public static final ProvisioningState UPDATING = fromString("Updating"); /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = new ProvisioningState("Succeeded"); + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = new ProvisioningState("Failed"); + public static final ProvisioningState FAILED = fromString("Failed"); /** Static value Canceled for ProvisioningState. */ - public static final ProvisioningState CANCELED = new ProvisioningState("Canceled"); - - private String value; + public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Creates a custom value for ProvisioningState. - * @param value the custom value + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState */ - public ProvisioningState(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ProvisioningState)) { - return false; - } - if (obj == this) { - return true; - } - ProvisioningState rhs = (ProvisioningState) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); } } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/RollingUpgradeMonitoringPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/RollingUpgradeMonitoringPolicy.java new file mode 100644 index 00000000000..c802eb062af --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/RollingUpgradeMonitoringPolicy.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The policy used for monitoring the application upgrade. + */ +public class RollingUpgradeMonitoringPolicy { + /** + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string + * representing an ISO 8601 duration. If that fails, then it is interpreted + * as a number representing the total number of milliseconds. + */ + @JsonProperty(value = "healthCheckWaitDuration") + private String healthCheckWaitDuration; + + /** + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that + * fails, then it is interpreted as a number representing the total number + * of milliseconds. + */ + @JsonProperty(value = "healthCheckStableDuration") + private String healthCheckStableDuration; + + /** + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that + * fails, then it is interpreted as a number representing the total number + * of milliseconds. + */ + @JsonProperty(value = "healthCheckRetryTimeout") + private String healthCheckRetryTimeout; + + /** + * The amount of time the overall upgrade has to complete before + * FailureAction is executed. It is first interpreted as a string + * representing an ISO 8601 duration. If that fails, then it is interpreted + * as a number representing the total number of milliseconds. + */ + @JsonProperty(value = "upgradeTimeout") + private String upgradeTimeout; + + /** + * The amount of time each upgrade domain has to complete before + * FailureAction is executed. It is first interpreted as a string + * representing an ISO 8601 duration. If that fails, then it is interpreted + * as a number representing the total number of milliseconds. + */ + @JsonProperty(value = "upgradeDomainTimeout") + private String upgradeDomainTimeout; + + /** + * Get the healthCheckWaitDuration value. + * + * @return the healthCheckWaitDuration value + */ + public String healthCheckWaitDuration() { + return this.healthCheckWaitDuration; + } + + /** + * Set the healthCheckWaitDuration value. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * Get the healthCheckStableDuration value. + * + * @return the healthCheckStableDuration value + */ + public String healthCheckStableDuration() { + return this.healthCheckStableDuration; + } + + /** + * Set the healthCheckStableDuration value. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * Get the healthCheckRetryTimeout value. + * + * @return the healthCheckRetryTimeout value + */ + public String healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the healthCheckRetryTimeout value. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the upgradeTimeout value. + * + * @return the upgradeTimeout value + */ + public String upgradeTimeout() { + return this.upgradeTimeout; + } + + /** + * Set the upgradeTimeout value. + * + * @param upgradeTimeout the upgradeTimeout value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * Get the upgradeDomainTimeout value. + * + * @return the upgradeDomainTimeout value + */ + public String upgradeDomainTimeout() { + return this.upgradeDomainTimeout; + } + + /** + * Set the upgradeDomainTimeout value. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServerCertificateCommonName.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServerCertificateCommonName.java new file mode 100644 index 00000000000..887943378fc --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServerCertificateCommonName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the server certificate details using common name. + */ +public class ServerCertificateCommonName { + /** + * The common name of the server certificate. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /** + * The issuer thumbprint of the server certificate. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get the certificateCommonName value. + * + * @return the certificateCommonName value + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set the certificateCommonName value. + * + * @param certificateCommonName the certificateCommonName value to set + * @return the ServerCertificateCommonName object itself. + */ + public ServerCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get the certificateIssuerThumbprint value. + * + * @return the certificateIssuerThumbprint value + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set the certificateIssuerThumbprint value. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set + * @return the ServerCertificateCommonName object itself. + */ + public ServerCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServerCertificateCommonNames.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServerCertificateCommonNames.java new file mode 100644 index 00000000000..e0a85b33605 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServerCertificateCommonNames.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a list of server certificates referenced by common name that are + * used to secure the cluster. + */ +public class ServerCertificateCommonNames { + /** + * The list of server certificates referenced by common name that are used + * to secure the cluster. + */ + @JsonProperty(value = "commonNames") + private List commonNames; + + /** + * The local certificate store location. Possible values include: + * 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', + * 'Root', 'TrustedPeople', 'TrustedPublisher'. + */ + @JsonProperty(value = "x509StoreName") + private String x509StoreName; + + /** + * Get the commonNames value. + * + * @return the commonNames value + */ + public List commonNames() { + return this.commonNames; + } + + /** + * Set the commonNames value. + * + * @param commonNames the commonNames value to set + * @return the ServerCertificateCommonNames object itself. + */ + public ServerCertificateCommonNames withCommonNames(List commonNames) { + this.commonNames = commonNames; + return this; + } + + /** + * Get the x509StoreName value. + * + * @return the x509StoreName value + */ + public String x509StoreName() { + return this.x509StoreName; + } + + /** + * Set the x509StoreName value. + * + * @param x509StoreName the x509StoreName value to set + * @return the ServerCertificateCommonNames object itself. + */ + public ServerCertificateCommonNames withX509StoreName(String x509StoreName) { + this.x509StoreName = x509StoreName; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceCorrelationDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceCorrelationDescription.java new file mode 100644 index 00000000000..3d2a976b2ec --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceCorrelationDescription.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Creates a particular correlation between services. + */ +public class ServiceCorrelationDescription { + /** + * The ServiceCorrelationScheme which describes the relationship between + * this service and the service specified via ServiceName. Possible values + * include: 'Invalid', 'Affinity', 'AlignedAffinity', 'NonAlignedAffinity'. + */ + @JsonProperty(value = "Scheme", required = true) + private ServiceCorrelationScheme scheme; + + /** + * The name of the service that the correlation relationship is established + * with. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Get the scheme value. + * + * @return the scheme value + */ + public ServiceCorrelationScheme scheme() { + return this.scheme; + } + + /** + * Set the scheme value. + * + * @param scheme the scheme value to set + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withScheme(ServiceCorrelationScheme scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the serviceName value. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName value. + * + * @param serviceName the serviceName value to set + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceCorrelationScheme.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceCorrelationScheme.java new file mode 100644 index 00000000000..449661ed222 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceCorrelationScheme.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceCorrelationScheme. + */ +public final class ServiceCorrelationScheme extends ExpandableStringEnum { + /** Static value Invalid for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme INVALID = fromString("Invalid"); + + /** Static value Affinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme AFFINITY = fromString("Affinity"); + + /** Static value AlignedAffinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme ALIGNED_AFFINITY = fromString("AlignedAffinity"); + + /** Static value NonAlignedAffinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme NON_ALIGNED_AFFINITY = fromString("NonAlignedAffinity"); + + /** + * Creates or finds a ServiceCorrelationScheme from its string representation. + * @param name a name to look for + * @return the corresponding ServiceCorrelationScheme + */ + @JsonCreator + public static ServiceCorrelationScheme fromString(String name) { + return fromString(name, ServiceCorrelationScheme.class); + } + + /** + * @return known ServiceCorrelationScheme values + */ + public static Collection values() { + return values(ServiceCorrelationScheme.class); + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceKind.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceKind.java new file mode 100644 index 00000000000..a03249068e4 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceKind. + */ +public final class ServiceKind extends ExpandableStringEnum { + /** Static value Invalid for ServiceKind. */ + public static final ServiceKind INVALID = fromString("Invalid"); + + /** Static value Stateless for ServiceKind. */ + public static final ServiceKind STATELESS = fromString("Stateless"); + + /** Static value Stateful for ServiceKind. */ + public static final ServiceKind STATEFUL = fromString("Stateful"); + + /** + * Creates or finds a ServiceKind from its string representation. + * @param name a name to look for + * @return the corresponding ServiceKind + */ + @JsonCreator + public static ServiceKind fromString(String name) { + return fromString(name, ServiceKind.class); + } + + /** + * @return known ServiceKind values + */ + public static Collection values() { + return values(ServiceKind.class); + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceLoadMetricDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceLoadMetricDescription.java new file mode 100644 index 00000000000..2058e6f21c6 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceLoadMetricDescription.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies a metric to load balance a service during runtime. + */ +public class ServiceLoadMetricDescription { + /** + * The name of the metric. If the service chooses to report load during + * runtime, the load metric name should match the name that is specified in + * Name exactly. Note that metric names are case sensitive. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * The service load metric relative weight, compared to other metrics + * configured for this service, as a number. Possible values include: + * 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "Weight") + private ServiceLoadMetricWeight weight; + + /** + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Primary + * replica. + */ + @JsonProperty(value = "PrimaryDefaultLoad") + private Integer primaryDefaultLoad; + + /** + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Secondary + * replica. + */ + @JsonProperty(value = "SecondaryDefaultLoad") + private Integer secondaryDefaultLoad; + + /** + * Used only for Stateless services. The default amount of load, as a + * number, that this service creates for this metric. + */ + @JsonProperty(value = "DefaultLoad") + private Integer defaultLoad; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the weight value. + * + * @return the weight value + */ + public ServiceLoadMetricWeight weight() { + return this.weight; + } + + /** + * Set the weight value. + * + * @param weight the weight value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withWeight(ServiceLoadMetricWeight weight) { + this.weight = weight; + return this; + } + + /** + * Get the primaryDefaultLoad value. + * + * @return the primaryDefaultLoad value + */ + public Integer primaryDefaultLoad() { + return this.primaryDefaultLoad; + } + + /** + * Set the primaryDefaultLoad value. + * + * @param primaryDefaultLoad the primaryDefaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withPrimaryDefaultLoad(Integer primaryDefaultLoad) { + this.primaryDefaultLoad = primaryDefaultLoad; + return this; + } + + /** + * Get the secondaryDefaultLoad value. + * + * @return the secondaryDefaultLoad value + */ + public Integer secondaryDefaultLoad() { + return this.secondaryDefaultLoad; + } + + /** + * Set the secondaryDefaultLoad value. + * + * @param secondaryDefaultLoad the secondaryDefaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withSecondaryDefaultLoad(Integer secondaryDefaultLoad) { + this.secondaryDefaultLoad = secondaryDefaultLoad; + return this; + } + + /** + * Get the defaultLoad value. + * + * @return the defaultLoad value + */ + public Integer defaultLoad() { + return this.defaultLoad; + } + + /** + * Set the defaultLoad value. + * + * @param defaultLoad the defaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withDefaultLoad(Integer defaultLoad) { + this.defaultLoad = defaultLoad; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceLoadMetricWeight.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceLoadMetricWeight.java new file mode 100644 index 00000000000..73ced1061fd --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceLoadMetricWeight.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceLoadMetricWeight. + */ +public final class ServiceLoadMetricWeight extends ExpandableStringEnum { + /** Static value Zero for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight ZERO = fromString("Zero"); + + /** Static value Low for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight LOW = fromString("Low"); + + /** Static value Medium for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight MEDIUM = fromString("Medium"); + + /** Static value High for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight HIGH = fromString("High"); + + /** + * Creates or finds a ServiceLoadMetricWeight from its string representation. + * @param name a name to look for + * @return the corresponding ServiceLoadMetricWeight + */ + @JsonCreator + public static ServiceLoadMetricWeight fromString(String name) { + return fromString(name, ServiceLoadMetricWeight.class); + } + + /** + * @return known ServiceLoadMetricWeight values + */ + public static Collection values() { + return values(ServiceLoadMetricWeight.class); + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServicePlacementPolicyDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServicePlacementPolicyDescription.java new file mode 100644 index 00000000000..8041bdc545a --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServicePlacementPolicyDescription.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("ServicePlacementPolicyDescription") +public class ServicePlacementPolicyDescription { +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServicePlacementPolicyType.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServicePlacementPolicyType.java new file mode 100644 index 00000000000..3fe7f0044a8 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServicePlacementPolicyType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServicePlacementPolicyType. + */ +public final class ServicePlacementPolicyType extends ExpandableStringEnum { + /** Static value Invalid for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType INVALID = fromString("Invalid"); + + /** Static value InvalidDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType INVALID_DOMAIN = fromString("InvalidDomain"); + + /** Static value RequiredDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType REQUIRED_DOMAIN = fromString("RequiredDomain"); + + /** Static value PreferredPrimaryDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType PREFERRED_PRIMARY_DOMAIN = fromString("PreferredPrimaryDomain"); + + /** Static value RequiredDomainDistribution for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType REQUIRED_DOMAIN_DISTRIBUTION = fromString("RequiredDomainDistribution"); + + /** Static value NonPartiallyPlaceService for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType NON_PARTIALLY_PLACE_SERVICE = fromString("NonPartiallyPlaceService"); + + /** + * Creates or finds a ServicePlacementPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding ServicePlacementPolicyType + */ + @JsonCreator + public static ServicePlacementPolicyType fromString(String name) { + return fromString(name, ServicePlacementPolicyType.class); + } + + /** + * @return known ServicePlacementPolicyType values + */ + public static Collection values() { + return values(ServicePlacementPolicyType.class); + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourceProperties.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourceProperties.java new file mode 100644 index 00000000000..3300a59f8fe --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourceProperties.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The service resource properties. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("ServiceResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceProperties.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceProperties.class) +}) +public class ServiceResourceProperties extends ServiceResourcePropertiesBase { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the service type. + */ + @JsonProperty(value = "serviceTypeName") + private String serviceTypeName; + + /** + * Describes how the service is partitioned. + */ + @JsonProperty(value = "partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the serviceTypeName value. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the serviceTypeName value. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription value. + * + * @return the partitionDescription value + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription value. + * + * @param partitionDescription the partitionDescription value to set + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourcePropertiesBase.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourcePropertiesBase.java new file mode 100644 index 00000000000..f7d3dddf209 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourcePropertiesBase.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The common service resource properties. + */ +public class ServiceResourcePropertiesBase { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "placementConstraints") + private String placementConstraints; + + /** + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "correlationScheme") + private List correlationScheme; + + /** + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Specifies the move cost for the service. Possible values include: + * 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "defaultMoveCost") + private MoveCost defaultMoveCost; + + /** + * Get the placementConstraints value. + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints value. + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the defaultMoveCost value. + * + * @return the defaultMoveCost value + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the defaultMoveCost value. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourceUpdateProperties.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourceUpdateProperties.java new file mode 100644 index 00000000000..fc56d5b71ea --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceResourceUpdateProperties.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The service resource properties for patch operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("ServiceResourceUpdateProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceUpdateProperties.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceUpdateProperties.class) +}) +public class ServiceResourceUpdateProperties extends ServiceResourcePropertiesBase { +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceTypeDeltaHealthPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceTypeDeltaHealthPolicy.java new file mode 100644 index 00000000000..9564befe193 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceTypeDeltaHealthPolicy.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the delta health policy used to evaluate the health of services + * belonging to a service type when upgrading the cluster. + */ +public class ServiceTypeDeltaHealthPolicy { + /** + * The maximum allowed percentage of services health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the services at the beginning + * of upgrade and the state of the services at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyServices") + private Integer maxPercentDeltaUnhealthyServices; + + /** + * Get the maxPercentDeltaUnhealthyServices value. + * + * @return the maxPercentDeltaUnhealthyServices value + */ + public Integer maxPercentDeltaUnhealthyServices() { + return this.maxPercentDeltaUnhealthyServices; + } + + /** + * Set the maxPercentDeltaUnhealthyServices value. + * + * @param maxPercentDeltaUnhealthyServices the maxPercentDeltaUnhealthyServices value to set + * @return the ServiceTypeDeltaHealthPolicy object itself. + */ + public ServiceTypeDeltaHealthPolicy withMaxPercentDeltaUnhealthyServices(Integer maxPercentDeltaUnhealthyServices) { + this.maxPercentDeltaUnhealthyServices = maxPercentDeltaUnhealthyServices; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceTypeHealthPolicy.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceTypeHealthPolicy.java new file mode 100644 index 00000000000..939ac683a6a --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/ServiceTypeHealthPolicy.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health policy used to evaluate the health of services + * belonging to a service type. + */ +public class ServiceTypeHealthPolicy { + /** + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + */ + @JsonProperty(value = "maxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /** + * Get the maxPercentUnhealthyServices value. + * + * @return the maxPercentUnhealthyServices value + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set the maxPercentUnhealthyServices value. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsParameterDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsParameterDescription.java index 26f09a80c2f..97f3596b14e 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsParameterDescription.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsParameterDescription.java @@ -11,17 +11,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * ServiceFabric settings under sections. + * Describes a parameter in fabric settings of the cluster. */ public class SettingsParameterDescription { /** - * The name of settings property. + * The parameter name of fabric setting. */ @JsonProperty(value = "name", required = true) private String name; /** - * The value of the property. + * The parameter value of fabric setting. */ @JsonProperty(value = "value", required = true) private String value; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsSectionDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsSectionDescription.java index 80a90e82c42..088fa273ec1 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsSectionDescription.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SettingsSectionDescription.java @@ -12,18 +12,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * ServiceFabric section settings. + * Describes a section in the fabric settings of the cluster. */ public class SettingsSectionDescription { /** - * The name of settings section. + * The section name of the fabric settings. */ @JsonProperty(value = "name", required = true) private String name; /** - * Collection of settings in the section, each setting is a tuple - * consisting of setting name and value. + * The collection of parameters in the section. */ @JsonProperty(value = "parameters", required = true) private List parameters; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SingletonPartitionSchemeDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SingletonPartitionSchemeDescription.java new file mode 100644 index 00000000000..0db69b7c000 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/SingletonPartitionSchemeDescription.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the partition scheme of a singleton-partitioned, or + * non-partitioned service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("Singleton") +public class SingletonPartitionSchemeDescription extends PartitionSchemeDescription { +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatefulServiceProperties.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatefulServiceProperties.java new file mode 100644 index 00000000000..959bf5f53a7 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatefulServiceProperties.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateful service resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateful") +public class StatefulServiceProperties extends ServiceResourceProperties { + /** + * A flag indicating whether this is a persistent service which stores + * states on the local disk. If it is then the value of this property is + * true, if not it is false. + */ + @JsonProperty(value = "hasPersistedState") + private Boolean hasPersistedState; + + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "targetReplicaSetSize") + private Integer targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "minReplicaSetSize") + private Integer minReplicaSetSize; + + /** + * The duration between when a replica goes down and when a new replica is + * created, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "replicaRestartWaitDuration") + private DateTime replicaRestartWaitDuration; + + /** + * The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "quorumLossWaitDuration") + private DateTime quorumLossWaitDuration; + + /** + * The definition on how long StandBy replicas should be maintained before + * being removed, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "standByReplicaKeepDuration") + private DateTime standByReplicaKeepDuration; + + /** + * Get the hasPersistedState value. + * + * @return the hasPersistedState value + */ + public Boolean hasPersistedState() { + return this.hasPersistedState; + } + + /** + * Set the hasPersistedState value. + * + * @param hasPersistedState the hasPersistedState value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withHasPersistedState(Boolean hasPersistedState) { + this.hasPersistedState = hasPersistedState; + return this; + } + + /** + * Get the targetReplicaSetSize value. + * + * @return the targetReplicaSetSize value + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the targetReplicaSetSize value. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minReplicaSetSize value. + * + * @return the minReplicaSetSize value + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minReplicaSetSize value. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the replicaRestartWaitDuration value. + * + * @return the replicaRestartWaitDuration value + */ + public DateTime replicaRestartWaitDuration() { + return this.replicaRestartWaitDuration; + } + + /** + * Set the replicaRestartWaitDuration value. + * + * @param replicaRestartWaitDuration the replicaRestartWaitDuration value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withReplicaRestartWaitDuration(DateTime replicaRestartWaitDuration) { + this.replicaRestartWaitDuration = replicaRestartWaitDuration; + return this; + } + + /** + * Get the quorumLossWaitDuration value. + * + * @return the quorumLossWaitDuration value + */ + public DateTime quorumLossWaitDuration() { + return this.quorumLossWaitDuration; + } + + /** + * Set the quorumLossWaitDuration value. + * + * @param quorumLossWaitDuration the quorumLossWaitDuration value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withQuorumLossWaitDuration(DateTime quorumLossWaitDuration) { + this.quorumLossWaitDuration = quorumLossWaitDuration; + return this; + } + + /** + * Get the standByReplicaKeepDuration value. + * + * @return the standByReplicaKeepDuration value + */ + public DateTime standByReplicaKeepDuration() { + return this.standByReplicaKeepDuration; + } + + /** + * Set the standByReplicaKeepDuration value. + * + * @param standByReplicaKeepDuration the standByReplicaKeepDuration value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withStandByReplicaKeepDuration(DateTime standByReplicaKeepDuration) { + this.standByReplicaKeepDuration = standByReplicaKeepDuration; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatefulServiceUpdateProperties.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatefulServiceUpdateProperties.java new file mode 100644 index 00000000000..56101a21891 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatefulServiceUpdateProperties.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateful service resource for patch operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateful") +public class StatefulServiceUpdateProperties extends ServiceResourceUpdateProperties { + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "targetReplicaSetSize") + private Integer targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "minReplicaSetSize") + private Integer minReplicaSetSize; + + /** + * The duration between when a replica goes down and when a new replica is + * created, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "replicaRestartWaitDuration") + private DateTime replicaRestartWaitDuration; + + /** + * The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "quorumLossWaitDuration") + private DateTime quorumLossWaitDuration; + + /** + * The definition on how long StandBy replicas should be maintained before + * being removed, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "standByReplicaKeepDuration") + private DateTime standByReplicaKeepDuration; + + /** + * Get the targetReplicaSetSize value. + * + * @return the targetReplicaSetSize value + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the targetReplicaSetSize value. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minReplicaSetSize value. + * + * @return the minReplicaSetSize value + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minReplicaSetSize value. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the replicaRestartWaitDuration value. + * + * @return the replicaRestartWaitDuration value + */ + public DateTime replicaRestartWaitDuration() { + return this.replicaRestartWaitDuration; + } + + /** + * Set the replicaRestartWaitDuration value. + * + * @param replicaRestartWaitDuration the replicaRestartWaitDuration value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withReplicaRestartWaitDuration(DateTime replicaRestartWaitDuration) { + this.replicaRestartWaitDuration = replicaRestartWaitDuration; + return this; + } + + /** + * Get the quorumLossWaitDuration value. + * + * @return the quorumLossWaitDuration value + */ + public DateTime quorumLossWaitDuration() { + return this.quorumLossWaitDuration; + } + + /** + * Set the quorumLossWaitDuration value. + * + * @param quorumLossWaitDuration the quorumLossWaitDuration value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withQuorumLossWaitDuration(DateTime quorumLossWaitDuration) { + this.quorumLossWaitDuration = quorumLossWaitDuration; + return this; + } + + /** + * Get the standByReplicaKeepDuration value. + * + * @return the standByReplicaKeepDuration value + */ + public DateTime standByReplicaKeepDuration() { + return this.standByReplicaKeepDuration; + } + + /** + * Set the standByReplicaKeepDuration value. + * + * @param standByReplicaKeepDuration the standByReplicaKeepDuration value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withStandByReplicaKeepDuration(DateTime standByReplicaKeepDuration) { + this.standByReplicaKeepDuration = standByReplicaKeepDuration; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatelessServiceProperties.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatelessServiceProperties.java new file mode 100644 index 00000000000..23ccb1d9326 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatelessServiceProperties.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateless service resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateless") +public class StatelessServiceProperties extends ServiceResourceProperties { + /** + * The instance count. + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /** + * Get the instanceCount value. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount value. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatelessServiceUpdateProperties.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatelessServiceUpdateProperties.java new file mode 100644 index 00000000000..932b1083c5c --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/StatelessServiceUpdateProperties.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateless service resource for patch operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateless") +public class StatelessServiceUpdateProperties extends ServiceResourceUpdateProperties { + /** + * The instance count. + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /** + * Get the instanceCount value. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount value. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServiceUpdateProperties object itself. + */ + public StatelessServiceUpdateProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/UniformInt64RangePartitionSchemeDescription.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/UniformInt64RangePartitionSchemeDescription.java new file mode 100644 index 00000000000..0bc651b98ea --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/UniformInt64RangePartitionSchemeDescription.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a partitioning scheme where an integer range is allocated evenly + * across a number of partitions. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("UniformInt64Range") +public class UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { + /** + * The number of partitions. + */ + @JsonProperty(value = "Count", required = true) + private int count; + + /** + * String indicating the lower bound of the partition key range that + * should be split between the partition ‘Count’. + */ + @JsonProperty(value = "LowKey", required = true) + private String lowKey; + + /** + * String indicating the upper bound of the partition key range that + * should be split between the partition ‘Count’. + */ + @JsonProperty(value = "HighKey", required = true) + private String highKey; + + /** + * Get the count value. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the lowKey value. + * + * @return the lowKey value + */ + public String lowKey() { + return this.lowKey; + } + + /** + * Set the lowKey value. + * + * @param lowKey the lowKey value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withLowKey(String lowKey) { + this.lowKey = lowKey; + return this; + } + + /** + * Get the highKey value. + * + * @return the highKey value + */ + public String highKey() { + return this.highKey; + } + + /** + * Set the highKey value. + * + * @param highKey the highKey value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withHighKey(String highKey) { + this.highKey = highKey; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceInner.java new file mode 100644 index 00000000000..c3d910284ad --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceInner.java @@ -0,0 +1,284 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.Map; +import com.microsoft.azure.management.servicefabric.ApplicationUpgradePolicy; +import java.util.List; +import com.microsoft.azure.management.servicefabric.ApplicationMetricDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application resource. + */ +@JsonFlatten +public class ApplicationResourceInner extends ProxyResource { + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /** + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "properties.parameters") + private Map parameters; + + /** + * Describes the policy for a monitored application upgrade. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /** + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /** + * Remove the current application capacity settings. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /** + * List of application capacity metric description. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "properties.typeName") + private String typeName; + + /** + * Azure resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the typeVersion value. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion value. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy value. + * + * @return the upgradePolicy value + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy value. + * + * @param upgradePolicy the upgradePolicy value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimumNodes value. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimumNodes value. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximumNodes value. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximumNodes value. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the removeApplicationCapacity value. + * + * @return the removeApplicationCapacity value + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the removeApplicationCapacity value. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics value. + * + * @return the metrics value + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics value. + * + * @param metrics the metrics value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the typeName value. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName value. + * + * @param typeName the typeName value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceListInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceListInner.java new file mode 100644 index 00000000000..87f7e108969 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application resources. + */ +public class ApplicationResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationResourceListInner object itself. + */ + public ApplicationResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceUpdateInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceUpdateInner.java new file mode 100644 index 00000000000..2962c64afd9 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationResourceUpdateInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.Map; +import com.microsoft.azure.management.servicefabric.ApplicationUpgradePolicy; +import java.util.List; +import com.microsoft.azure.management.servicefabric.ApplicationMetricDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application resource for patch operations. + */ +@JsonFlatten +public class ApplicationResourceUpdateInner extends ProxyResource { + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /** + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "properties.parameters") + private Map parameters; + + /** + * Describes the policy for a monitored application upgrade. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /** + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /** + * Remove the current application capacity settings. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /** + * List of application capacity metric description. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /** + * Azure resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the typeVersion value. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion value. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy value. + * + * @return the upgradePolicy value + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy value. + * + * @param upgradePolicy the upgradePolicy value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimumNodes value. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimumNodes value. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximumNodes value. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximumNodes value. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the removeApplicationCapacity value. + * + * @return the removeApplicationCapacity value + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the removeApplicationCapacity value. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics value. + * + * @return the metrics value + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics value. + * + * @param metrics the metrics value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeResourceInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeResourceInner.java new file mode 100644 index 00000000000..66f44dcd8de --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeResourceInner.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application type name resource. + */ +@JsonFlatten +public class ApplicationTypeResourceInner extends ProxyResource { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Azure resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the ApplicationTypeResourceInner object itself. + */ + public ApplicationTypeResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeResourceListInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeResourceListInner.java new file mode 100644 index 00000000000..a56b3e977ec --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeResourceListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application type names. + */ +public class ApplicationTypeResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationTypeResourceListInner object itself. + */ + public ApplicationTypeResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionResourceInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionResourceInner.java new file mode 100644 index 00000000000..cf383ee804d --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionResourceInner.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An application type version resource for the specified application type name + * resource. + */ +@JsonFlatten +public class ApplicationTypeVersionResourceInner extends ProxyResource { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The URL to the application package. + */ + @JsonProperty(value = "properties.appPackageUrl", required = true) + private String appPackageUrl; + + /** + * List of application type parameters that can be overridden when creating + * or updating the application. + */ + @JsonProperty(value = "properties.defaultParameterList", access = JsonProperty.Access.WRITE_ONLY) + private Map defaultParameterList; + + /** + * Azure resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the appPackageUrl value. + * + * @return the appPackageUrl value + */ + public String appPackageUrl() { + return this.appPackageUrl; + } + + /** + * Set the appPackageUrl value. + * + * @param appPackageUrl the appPackageUrl value to set + * @return the ApplicationTypeVersionResourceInner object itself. + */ + public ApplicationTypeVersionResourceInner withAppPackageUrl(String appPackageUrl) { + this.appPackageUrl = appPackageUrl; + return this; + } + + /** + * Get the defaultParameterList value. + * + * @return the defaultParameterList value + */ + public Map defaultParameterList() { + return this.defaultParameterList; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the ApplicationTypeVersionResourceInner object itself. + */ + public ApplicationTypeVersionResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionResourceListInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionResourceListInner.java new file mode 100644 index 00000000000..4e96cec4f08 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionResourceListInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application type version resources for the specified application + * type name resource. + */ +public class ApplicationTypeVersionResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationTypeVersionResourceListInner object itself. + */ + public ApplicationTypeVersionResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionsInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionsInner.java new file mode 100644 index 00000000000..353cf423bb8 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypeVersionsInner.java @@ -0,0 +1,670 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.ErrorModelException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationTypeVersions. + */ +public class ApplicationTypeVersionsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationTypeVersionsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationTypeVersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationTypeVersionsInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ApplicationTypeVersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationTypeVersions to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationTypeVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypeVersions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypeVersions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Body ApplicationTypeVersionResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypeVersions beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Body ApplicationTypeVersionResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypeVersions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypeVersions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypeVersions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a Service Fabric application type version resource. + * Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeVersionResourceInner object if successful. + */ + public ApplicationTypeVersionResourceInner get(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version).toBlocking().single().body(); + } + + /** + * Gets a Service Fabric application type version resource. + * Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @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 getAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version), serviceCallback); + } + + /** + * Gets a Service Fabric application type version resource. + * Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeVersionResourceInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version).map(new Func1, ApplicationTypeVersionResourceInner>() { + @Override + public ApplicationTypeVersionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Service Fabric application type version resource. + * Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeVersionResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeVersionResourceInner object if successful. + */ + public ApplicationTypeVersionResourceInner create(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters).map(new Func1, ApplicationTypeVersionResourceInner>() { + @Override + public ApplicationTypeVersionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeVersionResourceInner object if successful. + */ + public ApplicationTypeVersionResourceInner beginCreate(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeVersionResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters).map(new Func1, ApplicationTypeVersionResourceInner>() { + @Override + public ApplicationTypeVersionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric application type version resource. + * Create or update a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeVersionResourceInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version).toBlocking().last().body(); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @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 deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version), serviceCallback); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version).toBlocking().single().body(); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @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 beginDeleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version), serviceCallback); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, version).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric application type version resource. + * Delete a Service Fabric application type version resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param version The application type version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the list of application type version resources created in the specified Service Fabric application type name resource. + * Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeVersionResourceListInner object if successful. + */ + public ApplicationTypeVersionResourceListInner list(String resourceGroupName, String clusterName, String applicationTypeName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).toBlocking().single().body(); + } + + /** + * Gets the list of application type version resources created in the specified Service Fabric application type name resource. + * Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @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 listAsync(String resourceGroupName, String clusterName, String applicationTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName), serviceCallback); + } + + /** + * Gets the list of application type version resources created in the specified Service Fabric application type name resource. + * Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeVersionResourceListInner object + */ + public Observable listAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).map(new Func1, ApplicationTypeVersionResourceListInner>() { + @Override + public ApplicationTypeVersionResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of application type version resources created in the specified Service Fabric application type name resource. + * Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeVersionResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypesInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypesInner.java new file mode 100644 index 00000000000..86a4d85291e --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationTypesInner.java @@ -0,0 +1,626 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.ErrorModelException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationTypes. + */ +public class ApplicationTypesInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationTypesService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationTypesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationTypesInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ApplicationTypesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationTypes to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationTypesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypes create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ApplicationTypeResourceInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ApplicationTypes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a Service Fabric application type name resource. + * Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceInner object if successful. + */ + public ApplicationTypeResourceInner get(String resourceGroupName, String clusterName, String applicationTypeName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).toBlocking().single().body(); + } + + /** + * Gets a Service Fabric application type name resource. + * Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @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 getAsync(String resourceGroupName, String clusterName, String applicationTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName), serviceCallback); + } + + /** + * Gets a Service Fabric application type name resource. + * Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).map(new Func1, ApplicationTypeResourceInner>() { + @Override + public ApplicationTypeResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Service Fabric application type name resource. + * Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceInner object if successful. + */ + public ApplicationTypeResourceInner create(String resourceGroupName, String clusterName, String applicationTypeName) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName), serviceCallback); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).map(new Func1, ApplicationTypeResourceInner>() { + @Override + public ApplicationTypeResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + final String location = null; + ApplicationTypeResourceInner parameters = new ApplicationTypeResourceInner(); + parameters.withLocation(null); + return service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param location Azure resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceInner object if successful. + */ + public ApplicationTypeResourceInner create(String resourceGroupName, String clusterName, String applicationTypeName, String location) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, location).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param location Azure resource location. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationTypeName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, location), serviceCallback); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param location Azure resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationTypeName, String location) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName, location).map(new Func1, ApplicationTypeResourceInner>() { + @Override + public ApplicationTypeResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric application type name resource. + * Create or update a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @param location Azure resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + ApplicationTypeResourceInner parameters = new ApplicationTypeResourceInner(); + parameters.withLocation(location); + return service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationTypeName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).toBlocking().last().body(); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @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 deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName), serviceCallback); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationTypeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).toBlocking().single().body(); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @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 beginDeleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName), serviceCallback); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationTypeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric application type name resource. + * Delete a Service Fabric application type name resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationTypeName The name of the application type name resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceListInner object if successful. + */ + public ApplicationTypeResourceListInner list(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @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 listAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceListInner object + */ + public Observable listAsync(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ApplicationTypeResourceListInner>() { + @Override + public ApplicationTypeResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationsInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationsInner.java new file mode 100644 index 00000000000..5c0e2ea23cd --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ApplicationsInner.java @@ -0,0 +1,826 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.ErrorModelException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceUpdateInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceUpdateInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a Service Fabric application resource. + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceInner object if successful. + */ + public ApplicationResourceInner get(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Gets a Service Fabric application resource. + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @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 getAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Gets a Service Fabric application resource. + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ApplicationResourceInner>() { + @Override + public ApplicationResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Service Fabric application resource. + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceInner object if successful. + */ + public ApplicationResourceInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationResourceInner>() { + @Override + public ApplicationResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceInner object if successful. + */ + public ApplicationResourceInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationResourceInner>() { + @Override + public ApplicationResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric application resource. + * Create or update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceUpdateInner object if successful. + */ + public ApplicationResourceUpdateInner update(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @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 updateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationResourceUpdateInner>() { + @Override + public ApplicationResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceUpdateInner object if successful. + */ + public ApplicationResourceUpdateInner beginUpdate(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @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 beginUpdateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceUpdateInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationResourceUpdateInner>() { + @Override + public ApplicationResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Service Fabric application resource. + * Update a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceUpdateInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdateInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().last().body(); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @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 deleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @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 beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric application resource. + * Delete a Service Fabric application resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceListInner object if successful. + */ + public ApplicationResourceListInner list(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @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 listAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceListInner object + */ + public Observable listAsync(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ApplicationResourceListInner>() { + @Override + public ApplicationResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterCodeVersionsListResultInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterCodeVersionsListResultInner.java new file mode 100644 index 00000000000..a97c611f060 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterCodeVersionsListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.ClusterCodeVersionsResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list results of the ServiceFabric runtime versions. + */ +public class ClusterCodeVersionsListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ClusterCodeVersionsListResultInner object itself. + */ + public ClusterCodeVersionsListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink value. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink value. + * + * @param nextLink the nextLink value to set + * @return the ClusterCodeVersionsListResultInner object itself. + */ + public ClusterCodeVersionsListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterInner.java index 528b8874dc5..3d621938fce 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterInner.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterInner.java @@ -10,14 +10,15 @@ import java.util.List; import com.microsoft.azure.management.servicefabric.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.AzureActiveDirectory; import com.microsoft.azure.management.servicefabric.CertificateDescription; -import com.microsoft.azure.management.servicefabric.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.ServerCertificateCommonNames; import com.microsoft.azure.management.servicefabric.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.DiagnosticsStorageAccountConfig; import com.microsoft.azure.management.servicefabric.SettingsSectionDescription; import com.microsoft.azure.management.servicefabric.NodeTypeDescription; -import com.microsoft.azure.management.servicefabric.AzureActiveDirectory; import com.microsoft.azure.management.servicefabric.ProvisioningState; -import com.microsoft.azure.management.servicefabric.DiagnosticsStorageAccountConfig; import com.microsoft.azure.management.servicefabric.ClusterUpgradePolicy; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -29,88 +30,124 @@ @JsonFlatten public class ClusterInner extends Resource { /** - * The available cluster code version which the cluster can upgrade to, - * note that you must choose upgradeMode to manual to upgrade to. + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /** + * The Service Fabric runtime versions available for this cluster. */ @JsonProperty(value = "properties.availableClusterVersions", access = JsonProperty.Access.WRITE_ONLY) private List availableClusterVersions; /** - * The unique identifier for the cluster resource. + * The AAD authentication settings of the cluster. */ - @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) - private String clusterId; + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; /** - * The state for the cluster. Possible values include: 'WaitingForNodes', - * 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', - * 'UpdatingUserCertificate', 'UpdatingInfrastructure', - * 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', - * 'Ready'. + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. */ - @JsonProperty(value = "properties.clusterState", access = JsonProperty.Access.WRITE_ONLY) - private String clusterState; + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; /** - * The endpoint for the cluster connecting to servicefabric resource - * provider. + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. */ - @JsonProperty(value = "properties.clusterEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String clusterEndpoint; + @JsonProperty(value = "properties.certificateCommonNames") + private ServerCertificateCommonNames certificateCommonNames; /** - * The ServiceFabric code version running in your cluster. + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. */ - @JsonProperty(value = "properties.clusterCodeVersion") - private String clusterCodeVersion; + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; /** - * This primay certificate will be used as cluster node to node security, - * SSL certificate for cluster management endpoint and default admin - * client. + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. */ - @JsonProperty(value = "properties.certificate") - private CertificateDescription certificate; + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; /** - * Cluster reliability level indicates replica set size of system service. - * Possible values include: 'Bronze', 'Silver', 'Gold', 'Platinum'. + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. */ - @JsonProperty(value = "properties.reliabilityLevel") - private String reliabilityLevel; + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; /** - * Cluster upgrade mode indicates if fabric upgrade is initiated - * automatically by the system or not. Possible values include: - * 'Automatic', 'Manual'. + * The Azure Resource Provider endpoint. A system service in the cluster + * connects to this endpoint. */ - @JsonProperty(value = "properties.upgradeMode") - private String upgradeMode; + @JsonProperty(value = "properties.clusterEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterEndpoint; /** - * The client thumbprint details ,it is used for client access for cluster - * operation. + * A service generated unique identifier for the cluster resource. */ - @JsonProperty(value = "properties.clientCertificateThumbprints") - private List clientCertificateThumbprints; + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; /** - * List of client certificates to whitelist based on common names. + * The current state of the cluster. + * + * - WaitingForNodes - Indicates that the cluster resource is created and + * the resource provider is waiting for Service Fabric VM extension to boot + * up and report to it. + * - Deploying - Indicates that the Service Fabric runtime is being + * installed on the VMs. Cluster resource will be in this state until the + * cluster boots up and system services are up. + * - BaselineUpgrade - Indicates that the cluster is upgrading to + * establishes the cluster version. This upgrade is automatically initiated + * when the cluster boots up for the first time. + * - UpdatingUserConfiguration - Indicates that the cluster is being + * upgraded with the user provided configuration. + * - UpdatingUserCertificate - Indicates that the cluster is being upgraded + * with the user provided certificate. + * - UpdatingInfrastructure - Indicates that the cluster is being upgraded + * with the latest Service Fabric runtime version. This happens only when + * the **upgradeMode** is set to 'Automatic'. + * - EnforcingClusterVersion - Indicates that cluster is on a different + * version than expected and the cluster is being upgraded to the expected + * version. + * - UpgradeServiceUnreachable - Indicates that the system service in the + * cluster is no longer polling the Resource Provider. Clusters in this + * state cannot be managed by the Resource Provider. + * - AutoScale - Indicates that the ReliabilityLevel of the cluster is + * being adjusted. + * - Ready - Indicates that the cluster is in a stable state. + * . Possible values include: 'WaitingForNodes', 'Deploying', + * 'BaselineUpgrade', 'UpdatingUserConfiguration', + * 'UpdatingUserCertificate', 'UpdatingInfrastructure', + * 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', + * 'Ready'. */ - @JsonProperty(value = "properties.clientCertificateCommonNames") - private List clientCertificateCommonNames; + @JsonProperty(value = "properties.clusterState", access = JsonProperty.Access.WRITE_ONLY) + private String clusterState; /** - * List of custom fabric settings to configure the cluster. + * The storage account information for storing Service Fabric diagnostic + * logs. */ - @JsonProperty(value = "properties.fabricSettings") - private List fabricSettings; + @JsonProperty(value = "properties.diagnosticsStorageAccountConfig") + private DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig; /** - * The server certificate used by reverse proxy. + * The list of custom fabric settings to configure the cluster. */ - @JsonProperty(value = "properties.reverseProxyCertificate") - private CertificateDescription reverseProxyCertificate; + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; /** * The http management endpoint of the cluster. @@ -119,17 +156,11 @@ public class ClusterInner extends Resource { private String managementEndpoint; /** - * The list of nodetypes that make up the cluster. + * The list of node types in the cluster. */ @JsonProperty(value = "properties.nodeTypes", required = true) private List nodeTypes; - /** - * The settings to enable AAD authentication on the cluster. - */ - @JsonProperty(value = "properties.azureActiveDirectory") - private AzureActiveDirectory azureActiveDirectory; - /** * The provisioning state of the cluster resource. Possible values include: * 'Updating', 'Succeeded', 'Failed', 'Canceled'. @@ -138,17 +169,36 @@ public class ClusterInner extends Resource { private ProvisioningState provisioningState; /** - * The name of VM image VMSS has been configured with. Generic names such - * as Windows or Linux can be used. + * The reliability level sets the replica set size of system services. + * Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. + * This should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of + * 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', + * 'Platinum'. */ - @JsonProperty(value = "properties.vmImage") - private String vmImage; + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; /** - * The storage diagnostics account configuration details. + * The server certificate used by reverse proxy. */ - @JsonProperty(value = "properties.diagnosticsStorageAccountConfig") - private DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig; + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.reverseProxyCertificateCommonNames") + private ServerCertificateCommonNames reverseProxyCertificateCommonNames; /** * The policy to use when upgrading the cluster. @@ -157,58 +207,72 @@ public class ClusterInner extends Resource { private ClusterUpgradePolicy upgradeDescription; /** - * Get the availableClusterVersions value. + * The upgrade mode of the cluster when new Service Fabric runtime version + * is available. * - * @return the availableClusterVersions value + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual'. */ - public List availableClusterVersions() { - return this.availableClusterVersions; - } + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; /** - * Get the clusterId value. + * The VM image VMSS has been configured with. Generic names such as + * Windows or Linux can be used. + */ + @JsonProperty(value = "properties.vmImage") + private String vmImage; + + /** + * Get the addOnFeatures value. * - * @return the clusterId value + * @return the addOnFeatures value */ - public String clusterId() { - return this.clusterId; + public List addOnFeatures() { + return this.addOnFeatures; } /** - * Get the clusterState value. + * Set the addOnFeatures value. * - * @return the clusterState value + * @param addOnFeatures the addOnFeatures value to set + * @return the ClusterInner object itself. */ - public String clusterState() { - return this.clusterState; + public ClusterInner withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; } /** - * Get the clusterEndpoint value. + * Get the availableClusterVersions value. * - * @return the clusterEndpoint value + * @return the availableClusterVersions value */ - public String clusterEndpoint() { - return this.clusterEndpoint; + public List availableClusterVersions() { + return this.availableClusterVersions; } /** - * Get the clusterCodeVersion value. + * Get the azureActiveDirectory value. * - * @return the clusterCodeVersion value + * @return the azureActiveDirectory value */ - public String clusterCodeVersion() { - return this.clusterCodeVersion; + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; } /** - * Set the clusterCodeVersion value. + * Set the azureActiveDirectory value. * - * @param clusterCodeVersion the clusterCodeVersion value to set + * @param azureActiveDirectory the azureActiveDirectory value to set * @return the ClusterInner object itself. */ - public ClusterInner withClusterCodeVersion(String clusterCodeVersion) { - this.clusterCodeVersion = clusterCodeVersion; + public ClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; return this; } @@ -233,42 +297,42 @@ public ClusterInner withCertificate(CertificateDescription certificate) { } /** - * Get the reliabilityLevel value. + * Get the certificateCommonNames value. * - * @return the reliabilityLevel value + * @return the certificateCommonNames value */ - public String reliabilityLevel() { - return this.reliabilityLevel; + public ServerCertificateCommonNames certificateCommonNames() { + return this.certificateCommonNames; } /** - * Set the reliabilityLevel value. + * Set the certificateCommonNames value. * - * @param reliabilityLevel the reliabilityLevel value to set + * @param certificateCommonNames the certificateCommonNames value to set * @return the ClusterInner object itself. */ - public ClusterInner withReliabilityLevel(String reliabilityLevel) { - this.reliabilityLevel = reliabilityLevel; + public ClusterInner withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + this.certificateCommonNames = certificateCommonNames; return this; } /** - * Get the upgradeMode value. + * Get the clientCertificateCommonNames value. * - * @return the upgradeMode value + * @return the clientCertificateCommonNames value */ - public String upgradeMode() { - return this.upgradeMode; + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; } /** - * Set the upgradeMode value. + * Set the clientCertificateCommonNames value. * - * @param upgradeMode the upgradeMode value to set + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set * @return the ClusterInner object itself. */ - public ClusterInner withUpgradeMode(String upgradeMode) { - this.upgradeMode = upgradeMode; + public ClusterInner withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; return this; } @@ -293,62 +357,89 @@ public ClusterInner withClientCertificateThumbprints(List clientCertificateCommonNames() { - return this.clientCertificateCommonNames; + public String clusterCodeVersion() { + return this.clusterCodeVersion; } /** - * Set the clientCertificateCommonNames value. + * Set the clusterCodeVersion value. * - * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @param clusterCodeVersion the clusterCodeVersion value to set * @return the ClusterInner object itself. */ - public ClusterInner withClientCertificateCommonNames(List clientCertificateCommonNames) { - this.clientCertificateCommonNames = clientCertificateCommonNames; + public ClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; return this; } /** - * Get the fabricSettings value. + * Get the clusterEndpoint value. * - * @return the fabricSettings value + * @return the clusterEndpoint value */ - public List fabricSettings() { - return this.fabricSettings; + public String clusterEndpoint() { + return this.clusterEndpoint; } /** - * Set the fabricSettings value. + * Get the clusterId value. * - * @param fabricSettings the fabricSettings value to set + * @return the clusterId value + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the clusterState value. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Get the diagnosticsStorageAccountConfig value. + * + * @return the diagnosticsStorageAccountConfig value + */ + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.diagnosticsStorageAccountConfig; + } + + /** + * Set the diagnosticsStorageAccountConfig value. + * + * @param diagnosticsStorageAccountConfig the diagnosticsStorageAccountConfig value to set * @return the ClusterInner object itself. */ - public ClusterInner withFabricSettings(List fabricSettings) { - this.fabricSettings = fabricSettings; + public ClusterInner withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.diagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig; return this; } /** - * Get the reverseProxyCertificate value. + * Get the fabricSettings value. * - * @return the reverseProxyCertificate value + * @return the fabricSettings value */ - public CertificateDescription reverseProxyCertificate() { - return this.reverseProxyCertificate; + public List fabricSettings() { + return this.fabricSettings; } /** - * Set the reverseProxyCertificate value. + * Set the fabricSettings value. * - * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @param fabricSettings the fabricSettings value to set * @return the ClusterInner object itself. */ - public ClusterInner withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { - this.reverseProxyCertificate = reverseProxyCertificate; + public ClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; return this; } @@ -393,71 +484,71 @@ public ClusterInner withNodeTypes(List nodeTypes) { } /** - * Get the azureActiveDirectory value. + * Get the provisioningState value. * - * @return the azureActiveDirectory value + * @return the provisioningState value */ - public AzureActiveDirectory azureActiveDirectory() { - return this.azureActiveDirectory; + public ProvisioningState provisioningState() { + return this.provisioningState; } /** - * Set the azureActiveDirectory value. + * Get the reliabilityLevel value. * - * @param azureActiveDirectory the azureActiveDirectory value to set - * @return the ClusterInner object itself. + * @return the reliabilityLevel value */ - public ClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { - this.azureActiveDirectory = azureActiveDirectory; - return this; + public String reliabilityLevel() { + return this.reliabilityLevel; } /** - * Get the provisioningState value. + * Set the reliabilityLevel value. * - * @return the provisioningState value + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterInner object itself. */ - public ProvisioningState provisioningState() { - return this.provisioningState; + public ClusterInner withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; } /** - * Get the vmImage value. + * Get the reverseProxyCertificate value. * - * @return the vmImage value + * @return the reverseProxyCertificate value */ - public String vmImage() { - return this.vmImage; + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; } /** - * Set the vmImage value. + * Set the reverseProxyCertificate value. * - * @param vmImage the vmImage value to set + * @param reverseProxyCertificate the reverseProxyCertificate value to set * @return the ClusterInner object itself. */ - public ClusterInner withVmImage(String vmImage) { - this.vmImage = vmImage; + public ClusterInner withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; return this; } /** - * Get the diagnosticsStorageAccountConfig value. + * Get the reverseProxyCertificateCommonNames value. * - * @return the diagnosticsStorageAccountConfig value + * @return the reverseProxyCertificateCommonNames value */ - public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { - return this.diagnosticsStorageAccountConfig; + public ServerCertificateCommonNames reverseProxyCertificateCommonNames() { + return this.reverseProxyCertificateCommonNames; } /** - * Set the diagnosticsStorageAccountConfig value. + * Set the reverseProxyCertificateCommonNames value. * - * @param diagnosticsStorageAccountConfig the diagnosticsStorageAccountConfig value to set + * @param reverseProxyCertificateCommonNames the reverseProxyCertificateCommonNames value to set * @return the ClusterInner object itself. */ - public ClusterInner withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { - this.diagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig; + public ClusterInner withReverseProxyCertificateCommonNames(ServerCertificateCommonNames reverseProxyCertificateCommonNames) { + this.reverseProxyCertificateCommonNames = reverseProxyCertificateCommonNames; return this; } @@ -481,4 +572,44 @@ public ClusterInner withUpgradeDescription(ClusterUpgradePolicy upgradeDescripti return this; } + /** + * Get the upgradeMode value. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode value. + * + * @param upgradeMode the upgradeMode value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeMode(String upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the vmImage value. + * + * @return the vmImage value + */ + public String vmImage() { + return this.vmImage; + } + + /** + * Set the vmImage value. + * + * @param vmImage the vmImage value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withVmImage(String vmImage) { + this.vmImage = vmImage; + return this; + } + } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterVersionsInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterVersionsInner.java index 8edff88e52b..5b724912f0e 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterVersionsInner.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClusterVersionsInner.java @@ -10,22 +10,17 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import java.io.IOException; -import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.Path; import retrofit2.http.Query; -import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -56,106 +51,173 @@ public ClusterVersionsInner(Retrofit retrofit, ServiceFabricManagementClientImpl * used by Retrofit to perform actually REST calls. */ interface ClusterVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ClusterVersions get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}") + Observable> get(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ClusterVersions getByEnvironment" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}") + Observable> getByEnvironment(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ClusterVersions list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions") - Observable> list(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ClusterVersions listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.ClusterVersions listByEnvironment" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions") + Observable> listByEnvironment(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } /** - * List cluster code versions by location. + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions, this is different from cluster location - * @param environment Cluster operating system, the default means all. Possible values include: 'Default', 'Windows', 'Linux' + * @param location The location for the cluster code versions. This is different from cluster location. + * @param clusterVersion The cluster code version. * @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<ClusterCodeVersionsResultInner> object if successful. + * @return the ClusterCodeVersionsListResultInner object if successful. */ - public PagedList list(final String location, final String environment) { - ServiceResponse> response = listSinglePageAsync(location, environment).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public ClusterCodeVersionsListResultInner get(String location, String clusterVersion) { + return getWithServiceResponseAsync(location, clusterVersion).toBlocking().single().body(); } /** - * List cluster code versions by location. + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions, this is different from cluster location - * @param environment Cluster operating system, the default means all. Possible values include: 'Default', 'Windows', 'Linux' + * @param location The location for the cluster code versions. This is different from cluster location. + * @param clusterVersion The cluster code version. * @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> listAsync(final String location, final String environment, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(location, environment), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture getAsync(String location, String clusterVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(location, clusterVersion), serviceCallback); } /** - * List cluster code versions by location. + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions, this is different from cluster location - * @param environment Cluster operating system, the default means all. Possible values include: 'Default', 'Windows', 'Linux' + * @param location The location for the cluster code versions. This is different from cluster location. + * @param clusterVersion The cluster code version. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + * @return the observable to the ClusterCodeVersionsListResultInner object */ - public Observable> listAsync(final String location, final String environment) { - return listWithServiceResponseAsync(location, environment) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable getAsync(String location, String clusterVersion) { + return getWithServiceResponseAsync(location, clusterVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * List cluster code versions by location. + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions, this is different from cluster location - * @param environment Cluster operating system, the default means all. Possible values include: 'Default', 'Windows', 'Linux' + * @param location The location for the cluster code versions. This is different from cluster location. + * @param clusterVersion The cluster code version. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + * @return the observable to the ClusterCodeVersionsListResultInner object */ - public Observable>> listWithServiceResponseAsync(final String location, final String environment) { - return listSinglePageAsync(location, environment) - .concatMap(new Func1>, Observable>>>() { + public Observable> getWithServiceResponseAsync(String location, String clusterVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (clusterVersion == null) { + throw new IllegalArgumentException("Parameter clusterVersion is required and cannot be null."); + } + final String apiVersion = "2018-02-01"; + return service.get(location, this.client.subscriptionId(), clusterVersion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * List cluster code versions by location. + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. * - ServiceResponse> * @param location The location for the cluster code versions, this is different from cluster location - ServiceResponse> * @param environment Cluster operating system, the default means all. Possible values include: 'Default', 'Windows', 'Linux' + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + * @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 ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner getByEnvironment(String location, String environment, String clusterVersion) { + return getByEnvironmentWithServiceResponseAsync(location, environment, clusterVersion).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version. + * @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 getByEnvironmentAsync(String location, String environment, String clusterVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByEnvironmentWithServiceResponseAsync(location, environment, clusterVersion), serviceCallback); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object */ - public Observable>> listSinglePageAsync(final String location, final String environment) { + public Observable getByEnvironmentAsync(String location, String environment, String clusterVersion) { + return getByEnvironmentWithServiceResponseAsync(location, environment, clusterVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable> getByEnvironmentWithServiceResponseAsync(String location, String environment, String clusterVersion) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -165,16 +227,17 @@ public Observable>> listSin if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + if (clusterVersion == null) { + throw new IllegalArgumentException("Parameter clusterVersion is required and cannot be null."); } - return service.list(location, environment, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-02-01"; + return service.getByEnvironment(location, environment, this.client.subscriptionId(), clusterVersion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = getByEnvironmentDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -182,110 +245,168 @@ public Observable>> call(Re }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse getByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * List cluster code versions by location. + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources by location. * - * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param location The location for the cluster code versions. This is different from cluster location. * @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<ClusterCodeVersionsResultInner> object if successful. + * @return the ClusterCodeVersionsListResultInner object if successful. */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public ClusterCodeVersionsListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); } /** - * List cluster code versions by location. + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources by location. * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param location The location for the cluster code versions. This is different from cluster location. * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); } /** - * List cluster code versions by location. + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources by location. * - * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param location The location for the cluster code versions. This is different from cluster location. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + * @return the observable to the ClusterCodeVersionsListResultInner object */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * List cluster code versions by location. + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources by location. * - * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param location The location for the cluster code versions. This is different from cluster location. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + * @return the observable to the ClusterCodeVersionsListResultInner object */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable> listWithServiceResponseAsync(String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-02-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @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 ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner listByEnvironment(String location, String environment) { + return listByEnvironmentWithServiceResponseAsync(location, environment).toBlocking().single().body(); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @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 listByEnvironmentAsync(String location, String environment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByEnvironmentWithServiceResponseAsync(location, environment), serviceCallback); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable listByEnvironmentAsync(String location, String environment) { + return listByEnvironmentWithServiceResponseAsync(location, environment).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + /** - * List cluster code versions by location. + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the ClusterCodeVersionsListResultInner object */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + public Observable> listByEnvironmentWithServiceResponseAsync(String location, String environment) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-02-01"; + return service.listByEnvironment(location, environment, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = listByEnvironmentDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -293,9 +414,9 @@ public Observable>> call(Re }); } - private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse listByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClustersInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClustersInner.java index b315a2d333a..198800b0450 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClustersInner.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ClustersInner.java @@ -13,9 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; -import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicefabric.ClusterUpdateParameters; import com.microsoft.azure.management.servicefabric.ErrorModelException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -35,7 +33,6 @@ import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; -import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -66,14 +63,6 @@ public ClustersInner(Retrofit retrofit, ServiceFabricManagementClientImpl client * used by Retrofit to perform actually REST calls. */ interface ClustersService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParametersInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters beginUpdate" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") - Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParametersInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -86,6 +75,14 @@ interface ClustersService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -98,56 +95,48 @@ interface ClustersService { @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters listByResourceGroupNext" }) - @GET - Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Clusters listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - } /** - * Update cluster configuration. + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); } /** - * Update cluster configuration. + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @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 updateAsync(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); } /** - * Update cluster configuration. + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the ClusterInner object */ - public Observable updateAsync(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -156,15 +145,15 @@ public ClusterInner call(ServiceResponse response) { } /** - * Update cluster configuration. + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the ClusterInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters) { + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -174,57 +163,71 @@ public Observable> updateWithServiceResponseAsync( if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.update(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + final String apiVersion = "2018-02-01"; + return service.getByResourceGroup(resourceGroupName, clusterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); } /** - * Update cluster configuration. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner beginUpdate(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); } /** - * Update cluster configuration. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @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 beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + public ServiceFuture createAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); } /** - * Update cluster configuration. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ClusterInner object + * @return the observable for the request */ - public Observable beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + public Observable createAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -233,15 +236,16 @@ public ClusterInner call(ServiceResponse response) { } /** - * Update cluster configuration. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ClusterInner object + * @return the observable for the request */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParametersInner parameters) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -251,72 +255,58 @@ public Observable> beginUpdateWithServiceResponseA if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - return service.beginUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginUpdateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ErrorModelException.class) - .build(response); + final String apiVersion = "2018-02-01"; + Observable> observable = service.create(resourceGroupName, clusterName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Get cluster resource. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); } /** - * Get cluster resource. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @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 getByResourceGroupAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); } /** - * Get cluster resource. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -325,14 +315,16 @@ public ClusterInner call(ServiceResponse response) { } /** - * Get cluster resource. + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -342,15 +334,17 @@ public Observable> getByResourceGroupWithServiceRe if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - return service.getByResourceGroup(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Validator.validate(parameters); + final String apiVersion = "2018-02-01"; + return service.beginCreate(resourceGroupName, clusterName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getByResourceGroupDelegate(response); + ServiceResponse clientResponse = beginCreateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -359,53 +353,57 @@ public Observable> call(Response res }); } - private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + private ServiceResponse beginCreateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorModelException.class) .build(response); } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @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 createAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + public Observable updateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -414,15 +412,16 @@ public ClusterInner call(ServiceResponse response) { } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -432,57 +431,58 @@ public Observable> createWithServiceResponseAsync( if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - Observable> observable = service.create(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2018-02-01"; + Observable> observable = service.update(resourceGroupName, clusterName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + public ClusterInner beginUpdate(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @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 beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -491,15 +491,16 @@ public ClusterInner call(ServiceResponse response) { } /** - * Create cluster resource. + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource - * @param parameters Put Request + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -509,19 +510,17 @@ public Observable> beginCreateWithServiceResponseA if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - return service.beginCreate(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-02-01"; + return service.beginUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateDelegate(response); + ServiceResponse clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -530,19 +529,20 @@ public Observable> call(Response res }); } - private ServiceResponse beginCreateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorModelException.class) .build(response); } /** - * Delete cluster resource. + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -552,10 +552,11 @@ public void delete(String resourceGroupName, String clusterName) { } /** - * Delete cluster resource. + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -565,10 +566,11 @@ public ServiceFuture deleteAsync(String resourceGroupName, String clusterN } /** - * Delete cluster resource. + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -582,10 +584,11 @@ public Void call(ServiceResponse response) { } /** - * Delete cluster resource. + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @param clusterName The name of the cluster resource + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -599,10 +602,8 @@ public Observable> deleteWithServiceResponseAsync(String r if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-02-01"; + return service.delete(resourceGroupName, clusterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -625,106 +626,81 @@ private ServiceResponse deleteDelegate(Response response) th } /** - * List cluster resource by resource group. + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @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<ClusterInner> object if successful. + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. */ - public PagedList listByResourceGroup(final String resourceGroupName) { - ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { @Override public Page nextPage(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + return null; } }; } /** - * List cluster resource by resource group. + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param resourceGroupName The name of the resource group. * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByResourceGroupSinglePageAsync(resourceGroupName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List cluster resource by resource group. - * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object - */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { - return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); } /** - * List cluster resource by resource group. + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ClusterInner> object */ - public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { - return listByResourceGroupSinglePageAsync(resourceGroupName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); - } - }); + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); } /** - * List cluster resource by resource group. + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - ServiceResponse> * @param resourceGroupName The name of the resource group to which the resource belongs or get created - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ClusterInner> object */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -732,328 +708,82 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorModelException.class) .build(response); } /** - * List cluster resource. + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. * - * @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<ClusterInner> object if successful. + * @return the PagedList object if successful. */ public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { @Override public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + return null; } }; } /** - * List cluster resource. + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. * * @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> listAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); } /** - * List cluster resource. + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object + * @return the observable to the List<ClusterInner> object */ public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List cluster resource. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object - */ - public Observable>> listWithServiceResponseAsync() { - return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); } /** - * List cluster resource. + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the List<ClusterInner> object */ - public Observable>> listSinglePageAsync() { + public Observable>> listWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * List cluster resource by resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @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<ClusterInner> object if successful. - */ - public PagedList listByResourceGroupNext(final String nextPageLink) { - ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List cluster resource by resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByResourceGroupNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List cluster resource by resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object - */ - public Observable> listByResourceGroupNextAsync(final String nextPageLink) { - return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List cluster resource by resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object - */ - public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List cluster resource by resource group. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByResourceGroupNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * List cluster resource. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @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<ClusterInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List cluster resource. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List cluster resource. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List cluster resource. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ClusterInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List cluster resource. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -1061,10 +791,10 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorModelException.class) .build(response); } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationResultInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationResultInner.java index 7dced4689cb..4bbcb7fadd5 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationResultInner.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationResultInner.java @@ -16,13 +16,13 @@ */ public class OperationResultInner { /** - * Result name. + * The name of the operation. */ @JsonProperty(value = "name") private String name; /** - * Dispaly of the result. + * The object that represents the operation. */ @JsonProperty(value = "display") private AvailableOperationDisplay display; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationsInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationsInner.java index 43577dcca07..be948d1b0a7 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationsInner.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/OperationsInner.java @@ -66,15 +66,17 @@ interface OperationsService { } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * + * @param apiVersion The version of the Service Fabric resouce provider API * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorModelException 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<OperationResultInner> object if successful. */ - public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + public PagedList list(final String apiVersion) { + ServiceResponse> response = listSinglePageAsync(apiVersion).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -84,15 +86,17 @@ public Page nextPage(String nextPageLink) { } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * + * @param apiVersion The version of the Service Fabric resouce provider API * @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> listAsync(final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final String apiVersion, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), + listSinglePageAsync(apiVersion), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -103,13 +107,15 @@ public Observable>> call(String nextP } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * + * @param apiVersion The version of the Service Fabric resouce provider API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<OperationResultInner> object */ - public Observable> listAsync() { - return listWithServiceResponseAsync() + public Observable> listAsync(final String apiVersion) { + return listWithServiceResponseAsync(apiVersion) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -119,13 +125,15 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync() { - return listSinglePageAsync() + public Observable>> listWithServiceResponseAsync(final String apiVersion) { + return listSinglePageAsync(apiVersion) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -139,21 +147,23 @@ public Observable>> call(ServiceRespo } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * + ServiceResponse> * @param apiVersion The version of the Service Fabric resouce provider API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync() { - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + public Observable>> listSinglePageAsync(final String apiVersion) { + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); } - return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -162,15 +172,16 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorModelException.class) .build(response); } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -189,7 +200,8 @@ public Page nextPage(String nextPageLink) { } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -210,7 +222,8 @@ public Observable>> call(String nextP } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -227,7 +240,8 @@ public Page call(ServiceResponse>> call(ServiceRespo } /** - * Lists all of the available ServiceFabric REST API operations. + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -264,7 +279,7 @@ public Observable>> listNextSinglePag @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -273,9 +288,9 @@ public Observable>> call(Response> listNextDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorModelException.class) .build(response); } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl.java index 212053fb5f0..e9b2d187794 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl.java @@ -22,7 +22,7 @@ public class PageImpl implements Page { /** * The link to the next page. */ - @JsonProperty("nextLink") + @JsonProperty("") private String nextPageLink; /** diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl1.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl1.java new file mode 100644 index 00000000000..7c3744e4e9a --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceFabricManagementClientImpl.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceFabricManagementClientImpl.java index e9ff9452b8a..4b4b2a68546 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceFabricManagementClientImpl.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceFabricManagementClientImpl.java @@ -51,18 +51,6 @@ public ServiceFabricManagementClientImpl withSubscriptionId(String subscriptionI return this; } - /** The version of the ServiceFabric resouce provider api. */ - private String apiVersion; - - /** - * Gets The version of the ServiceFabric resouce provider api. - * - * @return the apiVersion value. - */ - public String apiVersion() { - return this.apiVersion; - } - /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -171,6 +159,58 @@ public OperationsInner operations() { return this.operations; } + /** + * The ApplicationTypesInner object to access its operations. + */ + private ApplicationTypesInner applicationTypes; + + /** + * Gets the ApplicationTypesInner object to access its operations. + * @return the ApplicationTypesInner object. + */ + public ApplicationTypesInner applicationTypes() { + return this.applicationTypes; + } + + /** + * The ApplicationTypeVersionsInner object to access its operations. + */ + private ApplicationTypeVersionsInner applicationTypeVersions; + + /** + * Gets the ApplicationTypeVersionsInner object to access its operations. + * @return the ApplicationTypeVersionsInner object. + */ + public ApplicationTypeVersionsInner applicationTypeVersions() { + return this.applicationTypeVersions; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + /** * Initializes an instance of ServiceFabricManagementClient client. * @@ -202,13 +242,16 @@ public ServiceFabricManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2016-09-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.clusters = new ClustersInner(restClient().retrofit(), this); this.clusterVersions = new ClusterVersionsInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); + this.applicationTypes = new ApplicationTypesInner(restClient().retrofit(), this); + this.applicationTypeVersions = new ApplicationTypeVersionsInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -219,6 +262,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ServiceFabricManagementClient", "2016-09-01"); + return String.format("%s (%s)", super.userAgent(), "ServiceFabricManagementClient"); } } diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceInner.java new file mode 100644 index 00000000000..21f9fa5cdf9 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceInner.java @@ -0,0 +1,258 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.ServiceCorrelationDescription; +import com.microsoft.azure.management.servicefabric.ServiceLoadMetricDescription; +import com.microsoft.azure.management.servicefabric.ServicePlacementPolicyDescription; +import com.microsoft.azure.management.servicefabric.MoveCost; +import com.microsoft.azure.management.servicefabric.PartitionSchemeDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The service resource. + */ +@JsonFlatten +public class ServiceResourceInner extends ProxyResource { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /** + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /** + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Specifies the move cost for the service. Possible values include: + * 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private MoveCost defaultMoveCost; + + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the service type. + */ + @JsonProperty(value = "properties.serviceTypeName") + private String serviceTypeName; + + /** + * Describes how the service is partitioned. + */ + @JsonProperty(value = "properties.partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /** + * Azure resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the placementConstraints value. + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints value. + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the defaultMoveCost value. + * + * @return the defaultMoveCost value + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the defaultMoveCost value. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the serviceTypeName value. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the serviceTypeName value. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription value. + * + * @return the partitionDescription value + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription value. + * + * @param partitionDescription the partitionDescription value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceListInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceListInner.java new file mode 100644 index 00000000000..d41628085d4 --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of service resources. + */ +public class ServiceResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceUpdateInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceUpdateInner.java new file mode 100644 index 00000000000..71a282bfd7e --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServiceResourceUpdateInner.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.ServiceCorrelationDescription; +import com.microsoft.azure.management.servicefabric.ServiceLoadMetricDescription; +import com.microsoft.azure.management.servicefabric.ServicePlacementPolicyDescription; +import com.microsoft.azure.management.servicefabric.MoveCost; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The service resource for patch operations. + */ +@JsonFlatten +public class ServiceResourceUpdateInner extends ProxyResource { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /** + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /** + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Specifies the move cost for the service. Possible values include: + * 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private MoveCost defaultMoveCost; + + /** + * Azure resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the placementConstraints value. + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints value. + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the defaultMoveCost value. + * + * @return the defaultMoveCost value + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the defaultMoveCost value. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServicesInner.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServicesInner.java new file mode 100644 index 00000000000..3bb00bdb81e --- /dev/null +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/ServicesInner.java @@ -0,0 +1,882 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.ErrorModelException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceUpdateInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceUpdateInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.Services list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a Service Fabric service resource. + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceInner object if successful. + */ + public ServiceResourceInner get(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName).toBlocking().single().body(); + } + + /** + * Gets a Service Fabric service resource. + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @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 getAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName), serviceCallback); + } + + /** + * Gets a Service Fabric service resource. + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Service Fabric service resource. + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceInner object if successful. + */ + public ServiceResourceInner create(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceInner object if successful. + */ + public ServiceResourceInner beginCreate(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric service resource. + * Create or update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceUpdateInner object if successful. + */ + public ServiceResourceUpdateInner update(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @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 updateAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters), serviceCallback); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).map(new Func1, ServiceResourceUpdateInner>() { + @Override + public ServiceResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceUpdateInner object if successful. + */ + public ServiceResourceUpdateInner beginUpdate(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @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 beginUpdateAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters), serviceCallback); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceUpdateInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).map(new Func1, ServiceResourceUpdateInner>() { + @Override + public ServiceResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Service Fabric service resource. + * Update a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceUpdateInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdateInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName).toBlocking().last().body(); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @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 deleteAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName), serviceCallback); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName).toBlocking().single().body(); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @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 beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName), serviceCallback); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric service resource. + * Delete a Service Fabric service resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * Gets all service resources created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceListInner object if successful. + */ + public ServiceResourceListInner list(String resourceGroupName, String clusterName, String applicationName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * Gets all service resources created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @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 listAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * Gets all service resources created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceListInner object + */ + public Observable listAsync(String resourceGroupName, String clusterName, String applicationName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ServiceResourceListInner>() { + @Override + public ServiceResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * Gets all service resources created or in the process of being created in the Service Fabric application resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + final String apiVersion = "2017-07-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/package-info.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/package-info.java index 6e32883f35a..36f09ed8911 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/package-info.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/implementation/package-info.java @@ -6,5 +6,6 @@ /** * This package contains the implementation classes for ServiceFabricManagementClient. + * Service Fabric Management Client. */ package com.microsoft.azure.management.servicefabric.implementation; diff --git a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/package-info.java b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/package-info.java index 9100366d84b..d3a2803cc8b 100644 --- a/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/package-info.java +++ b/azure-mgmt-servicefabric/src/main/java/com/microsoft/azure/management/servicefabric/package-info.java @@ -6,5 +6,6 @@ /** * This package contains the classes for ServiceFabricManagementClient. + * Service Fabric Management Client. */ package com.microsoft.azure.management.servicefabric;