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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.2.0</version>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-appplatform</artifactId>
<version>1.0.0-beta-1</version>
<version>1.0.0-beta</version>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for AppPlatform Management</name>
<description>This package contains Microsoft AppPlatform Management SDK.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.AppPlatformManager;
import org.joda.time.DateTime;

/**
* Type representing AppResource.
Expand All @@ -27,6 +26,11 @@ public interface AppResource extends HasInner<AppResourceInner>, Indexable, Upda
*/
String id();

/**
* @return the location value.
*/
String location();

/**
* @return the name value.
*/
Expand All @@ -45,7 +49,7 @@ public interface AppResource extends HasInner<AppResourceInner>, Indexable, Upda
/**
* The entirety of the AppResource definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithProperties, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithCreate {
}

/**
Expand Down Expand Up @@ -79,18 +83,30 @@ interface WithServiceName {
* @param serviceName The name of the Service resource
* @return the next definition stage
*/
WithProperties withServiceName(String serviceName);
WithCreate withServiceName(String serviceName);
}

/**
* The stage of the appresource definition allowing to specify Location.
*/
interface WithLocation {
/**
* Specifies location.
* @param location The GEO location of the application, always the same with its parent resource
* @return the next definition stage
*/
WithCreate withLocation(String location);
}

/**
* The stage of the appresource definition allowing to specify Properties.
*/
interface WithProperties {
/**
* Specifies properties.
* @param properties Properties of the App resource
* @return the next definition stage
*/
/**
* Specifies properties.
* @param properties Properties of the App resource
* @return the next definition stage
*/
WithCreate withProperties(AppResourceProperties properties);
}

Expand All @@ -99,19 +115,31 @@ interface WithProperties {
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends Creatable<AppResource> {
interface WithCreate extends Creatable<AppResource>, DefinitionStages.WithLocation, DefinitionStages.WithProperties {
}
}
/**
* The template for a AppResource update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<AppResource>, UpdateStages.WithProperties {
interface Update extends Appliable<AppResource>, UpdateStages.WithLocation, UpdateStages.WithProperties {
}

/**
* Grouping of AppResource update stages.
*/
interface UpdateStages {
/**
* The stage of the appresource update allowing to specify Location.
*/
interface WithLocation {
/**
* Specifies location.
* @param location The GEO location of the application, always the same with its parent resource
* @return the next update stage
*/
Update withLocation(String location);
}

/**
* The stage of the appresource update allowing to specify Properties.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AppResourceProperties {

/**
* Provisioning state of the App. Possible values include: 'Succeeded',
* 'Failed'.
* 'Failed', 'Creating', 'Updating'.
*/
@JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private AppResourceProvisioningState provisioningState;
Expand Down Expand Up @@ -88,7 +88,7 @@ public String url() {
}

/**
* Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed'.
* Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating'.
*
* @return the provisioningState value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public final class AppResourceProvisioningState extends ExpandableStringEnum<App
/** Static value Failed for AppResourceProvisioningState. */
public static final AppResourceProvisioningState FAILED = fromString("Failed");

/** Static value Creating for AppResourceProvisioningState. */
public static final AppResourceProvisioningState CREATING = fromString("Creating");

/** Static value Updating for AppResourceProvisioningState. */
public static final AppResourceProvisioningState UPDATING = fromString("Updating");

/**
* Creates or finds a AppResourceProvisioningState from its string representation.
* @param name a name to look for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ public class DeploymentResourceProperties {

/**
* Provisioning state of the Deployment. Possible values include:
* 'Creating', 'Processing', 'Succeeded', 'Failed'.
* 'Creating', 'Updating', 'Succeeded', 'Failed'.
*/
@JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private DeploymentResourceProvisioningState provisioningState;

/**
* Status of the Deployment. Possible values include: 'Unknown', 'Stopped',
* 'Running', 'Failed', 'Processing', 'Allocating', 'Upgrading',
* 'Compiling'.
* 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling'.
*/
@JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
private DeploymentResourceStatus status;
Expand Down Expand Up @@ -117,7 +116,7 @@ public DeploymentResourceProperties withDeploymentSettings(DeploymentSettings de
}

/**
* Get provisioning state of the Deployment. Possible values include: 'Creating', 'Processing', 'Succeeded', 'Failed'.
* Get provisioning state of the Deployment. Possible values include: 'Creating', 'Updating', 'Succeeded', 'Failed'.
*
* @return the provisioningState value
*/
Expand All @@ -126,7 +125,7 @@ public DeploymentResourceProvisioningState provisioningState() {
}

/**
* Get status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Processing', 'Allocating', 'Upgrading', 'Compiling'.
* Get status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling'.
*
* @return the status value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public final class DeploymentResourceProvisioningState extends ExpandableStringE
/** Static value Creating for DeploymentResourceProvisioningState. */
public static final DeploymentResourceProvisioningState CREATING = fromString("Creating");

/** Static value Processing for DeploymentResourceProvisioningState. */
public static final DeploymentResourceProvisioningState PROCESSING = fromString("Processing");
/** Static value Updating for DeploymentResourceProvisioningState. */
public static final DeploymentResourceProvisioningState UPDATING = fromString("Updating");

/** Static value Succeeded for DeploymentResourceProvisioningState. */
public static final DeploymentResourceProvisioningState SUCCEEDED = fromString("Succeeded");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ public final class DeploymentResourceStatus extends ExpandableStringEnum<Deploym
/** Static value Failed for DeploymentResourceStatus. */
public static final DeploymentResourceStatus FAILED = fromString("Failed");

/** Static value Processing for DeploymentResourceStatus. */
public static final DeploymentResourceStatus PROCESSING = fromString("Processing");

/** Static value Allocating for DeploymentResourceStatus. */
public static final DeploymentResourceStatus ALLOCATING = fromString("Allocating");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import rx.Completable;
import rx.Observable;
import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.ServiceResourceInner;

/**
* Type representing Services.
Expand All @@ -30,10 +31,11 @@ public interface Services {
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param resource Parameters for the create or update operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ServiceResource> createOrUpdateAsync(String resourceGroupName, String serviceName);
Observable<ServiceResource> createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource);

/**
* Operation to delete a Service.
Expand All @@ -50,10 +52,11 @@ public interface Services {
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param resource Parameters for the update operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ServiceResource> updateAsync(String resourceGroupName, String serviceName);
Observable<ServiceResource> updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource);

/**
* Regenerate a test key for a Service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.LongRunningFinalState;
import com.microsoft.azure.LongRunningOperationOptions;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@
import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
import rx.Observable;
import com.microsoft.azure.management.appplatform.v2019_05_01_preview.AppResourceProperties;
import org.joda.time.DateTime;
import rx.functions.Func1;

class AppResourceImpl extends CreatableUpdatableImpl<AppResource, AppResourceInner, AppResourceImpl> implements AppResource, AppResource.Definition, AppResource.Update {
private String resourceGroupName;
private String serviceName;
private String appName;
private AppResourceProperties cproperties;
private AppResourceProperties uproperties;
private final AppPlatformManager manager;

AppResourceImpl(String name, AppPlatformManager manager) {
Expand All @@ -30,8 +26,6 @@ class AppResourceImpl extends CreatableUpdatableImpl<AppResource, AppResourceInn
// Set resource name
this.appName = name;
//
this.cproperties = new AppResourceProperties();
this.uproperties = new AppResourceProperties();
}

AppResourceImpl(AppResourceInner inner, AppPlatformManager manager) {
Expand All @@ -44,8 +38,6 @@ class AppResourceImpl extends CreatableUpdatableImpl<AppResource, AppResourceInn
this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "Spring");
this.appName = IdParsingUtils.getValueFromIdByName(inner.id(), "apps");
// set other parameters for create and update
this.cproperties = new AppResourceProperties();
this.uproperties = new AppResourceProperties();
}

@Override
Expand All @@ -56,28 +48,14 @@ public AppPlatformManager manager() {
@Override
public Observable<AppResource> createResourceAsync() {
AppsInner client = this.manager().inner().apps();
return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.cproperties)
.map(new Func1<AppResourceInner, AppResourceInner>() {
@Override
public AppResourceInner call(AppResourceInner resource) {
resetCreateUpdateParameters();
return resource;
}
})
return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.inner())
.map(innerToFluentMap(this));
}

@Override
public Observable<AppResource> updateResourceAsync() {
AppsInner client = this.manager().inner().apps();
return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.uproperties)
.map(new Func1<AppResourceInner, AppResourceInner>() {
@Override
public AppResourceInner call(AppResourceInner resource) {
resetCreateUpdateParameters();
return resource;
}
})
return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.inner())
.map(innerToFluentMap(this));
}

Expand All @@ -92,16 +70,17 @@ public boolean isInCreateMode() {
return this.inner().id() == null;
}

private void resetCreateUpdateParameters() {
this.cproperties = new AppResourceProperties();
this.uproperties = new AppResourceProperties();
}

@Override
public String id() {
return this.inner().id();
}

@Override
public String location() {
return this.inner().location();
}

@Override
public String name() {
return this.inner().name();
Expand Down Expand Up @@ -129,13 +108,15 @@ public AppResourceImpl withServiceName(String serviceName) {
return this;
}

@Override
public AppResourceImpl withLocation(String location) {
this.inner().withLocation(location);
return this;
}

@Override
public AppResourceImpl withProperties(AppResourceProperties properties) {
if (isInCreateMode()) {
this.cproperties = properties;
} else {
this.uproperties = properties;
}
this.inner().withProperties(properties);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ public class AppResourceInner extends ProxyResource {
@JsonProperty(value = "properties")
private AppResourceProperties properties;

/**
* The GEO location of the application, always the same with its parent
* resource.
*/
@JsonProperty(value = "location")
private String location;

/**
* Get properties of the App resource.
*
Expand All @@ -42,4 +49,24 @@ public AppResourceInner withProperties(AppResourceProperties properties) {
return this;
}

/**
* Get the GEO location of the application, always the same with its parent resource.
*
* @return the location value
*/
public String location() {
return this.location;
}

/**
* Set the GEO location of the application, always the same with its parent resource.
*
* @param location the location value to set
* @return the AppResourceInner object itself.
*/
public AppResourceInner withLocation(String location) {
this.location = location;
return this;
}

}
Loading