+ * An update domain represents the group of virtual * machines and underlying physical hardware that can be rebooted at the same time. * - * @return the platformUpdateDomainCount value + * @return the update domain count */ - Integer updateDomainCount(); + int updateDomainCount(); /** - * Get the fault domain count of availability set., a fault domain represents the group of virtual + * Returns the fault domain count of availability set. + *
+ * A fault domain represents the group of virtual
* machines that shares common power source and network switch.
*
- * @return the platformUpdateDomainCount value
+ * @return the fault domain count
*/
- Integer FaultDomainCount();
+ int faultDomainCount();
/**
- * Get the list of ids of virtual machines in the availability set.
+ * Lists the resource IDs of the virtual machines in the availability set.
*
- * @return the virtualMachineIds value
+ * @return list of resource ID strings
*/
List
+ * Call {@link Update#apply()} to apply the changes to the resource in Azure.
+ */
+ interface Update extends
+ Appliable
+ * Use {@link PublicIpAddress#ipAddress()} after the public IP address is created to obtain the
+ * actual IP address allocated for this resource by Azure
+ *
+ * @return the next stage of the public IP address definition
+ */
+ DefinitionCreatable withStaticIp();
+
+ /**
+ * Enables dynamic IP address allocation.
+ *
+ * @return the next stage of the public IP address definition
+ */
+ DefinitionCreatable withDynamicIp();
}
- interface DefinitionWithGroup extends GroupableResource.DefinitionWithGroup
+ * Use {@link PublicIpAddress#ipAddress()} after the public IP address is updated to
+ * obtain the actual IP address allocated for this resource by Azure
+ *
+ * @return the next stage of the public IP address definition
+ */
+ Update withStaticIp();
+
+ /**
+ * Enables dynamic IP address allocation.
+ *
+ * @return the next stage of the public IP address definition
+ */
+ Update withDynamicIp();
}
- public interface DefinitionWithIpAddress {
- /**
- * Enables static IP address allocation. The actual IP address allocated for this resource by Azure can be obtained
- * after the provisioning process is complete from ipAddress().
- * @return The next stage of the public IP address definition
- */
- DefinitionCreatable withStaticIp();
-
- /**
- * Enables dynamic IP address allocation.
- * @return The next stage of the public IP address definition
- */
- DefinitionCreatable withDynamicIp();
- }
-
-
- public interface UpdatableWithIpAddress
+ * The fully qualified domain name (FQDN)
+ * will be constructed automatically by appending the rest of the domain to this label.
+ * @param dnsName the leaf domain label to use. This must follow the required naming convention for leaf domain names.
+ * @return the next stage of the public IP address definition
+ */
+ DefinitionCreatable withLeafDomainLabel(String dnsName);
-
- /**
- * A public IP address definition allowing to specify the leaf domain label, if any
- */
- public interface DefinitionWithLeafDomainLabel {
- /**
- * Specifies the leaf domain label to associate with this public IP address. The fully qualified domain name (FQDN)
- * will be constructed automatically by appending the rest of the domain to this label.
- * @param dnsName The leaf domain label to use. This must follow the required naming convention for leaf domain names.
- * @return The next stage of the public IP address definition
- */
- DefinitionCreatable withLeafDomainLabel(String dnsName);
-
- /**
- * Ensures that no leaf domain label will be used. This means that this public IP address will not be associated with a domain name.
- * @return The next stage of the public IP address definition
- */
- DefinitionCreatable withoutLeafDomainLabel();
- }
-
-
- public interface UpdatableWithLeafDomainLabel
+ * This means that this public IP address will not be associated with a domain name.
+ * @return the next stage of the public IP address definition
+ */
+ DefinitionCreatable withoutLeafDomainLabel();
+ }
-
+
+ /**
+ * A public IP address update allowing to change the leaf domain label, if any
+ */
+ interface UpdateWithLeafDomainLabel {
+ /**
+ * Specifies the leaf domain label to associate with this public IP address.
+ *
+ * The fully qualified domain name (FQDN)
+ * will be constructed automatically by appending the rest of the domain to this label.
+ * @param dnsName the leaf domain label to use. This must follow the required naming convention for leaf domain names.
+ * @return the next stage of the public IP address definition
+ */
+ Update withLeafDomainLabel(String dnsName);
+
+ /**
+ * Ensures that no leaf domain label will be used.
+ *
+ * This means that this public IP address will not be associated with a domain name.
+ * @return the next stage of the resource definition
+ */
+ Update withoutLeafDomainLabel();
+ }
+
+
+ /**
+ * A public IP address definition allowing the reverse FQDN to be specified
+ */
+ interface DefinitionWithReverseFQDN
+ *
+ * @param reverseFQDN the reverse FQDN to assign
+ * @return the next stage of the resource definition
+ */
+ T withReverseFqdn(String reverseFQDN);
+
+ /**
+ * Ensures that no reverse FQDN will be used.
+ * @return the next stage of the resource definition
+ */
+ T withoutReverseFqdn();
+ }
+
+ /**
+ * A public IP address update allowing the reverse FQDN to be specified
+ */
+ interface UpdateWithReverseFQDN {
+ /**
+ * Specifies the reverse FQDN to assign to this public IP address
+ * @param reverseFQDN the reverse FQDN to assign
+ * @return the next stage of the resource update
+ */
+ Update withReverseFqdn(String reverseFQDN);
+
+ /**
+ * Ensures that no reverse FQDN will be used.
+ * @return The next stage of the resource update
+ */
+ Update withoutReverseFqdn();
+ }
+
+ /**
+ * The stage of the public IP definition which contains all the minimum required inputs for
+ * the resource to be created (via {@link DefinitionCreatable#create()}), but also allows
+ * for any other optional settings to be specified.
+ */
interface DefinitionCreatable extends
- Creatable
+ * Call {@link Update#apply()} to apply the changes to the resource in Azure.
+ */
interface Update extends
- Appliable
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsDeletingByGroup {
/**
- * Deletes a resource from a specific group
- * @param groupName The group the resource is part of
- * @param name The name of the resource within that group
+ * Deletes a resource from Azure, identifying it by its name and its resource group
+ * @param groupName the group the resource is part of
+ * @param name The name of the resource
* @throws Exception
*/
void delete(String groupName, String name) throws Exception;
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsGettingByGroup.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsGettingByGroup.java
index 6b92f205244b..1369776eae4e 100644
--- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsGettingByGroup.java
+++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsGettingByGroup.java
@@ -24,7 +24,19 @@
import java.io.IOException;
-// Requires class to support reading entities with a supplied group name
+/**
+ * Provides access to getting a specific Azure resource based on its name and resource group
+ *
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsGettingByGroup
+ * (Note: this interface is not intended to be implemented by user code)
+*/
public interface SupportsListingByGroup
+ * (Note: this interface is not intended to be implemented by user code)
+ * @param T the initial blank definition interface
+ */
public interface SupportsCreating
+ * This is the beginning of the builder pattern used to create top level resources
+ * in Azure. The final method completing the definition and starting the actual resource creation
+ * process in Azure is {@link Creatable#create()}.
+ *
+ * Note that the {@link Creatable#create()} method is
+ * only available at the stage of the resource definition that has the minimum set of input
+ * parameters specified. If you do not see {@link Creatable#create()} among the available methods, it
+ * means you have not yet specified all the required input settings. Input settings generally begin
+ * with the word "with", for example:
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsDeleting {
+ /**
+ * Deletes a resource from Azure, identifying it by its resource ID
+ * @param id the resource ID of the resource to delete
+ * @throws Exception
+ */
void delete(String id) throws Exception;
}
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsGetting.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsGetting.java
index cd3093618da9..5ef65f6f5d32 100644
--- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsGetting.java
+++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsGetting.java
@@ -23,7 +23,19 @@
import java.io.IOException;
-// Requires class to support reading entities
+/**
+ * Provides access to getting a specific Azure resource based on its ID
+ *
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsGetting
+ * @param id the full ID of the resource
+ * @return an immutable representation of the resource
+ * @throws CloudException
+ * @throws IOException
+ */
+ T get(String id) throws CloudException, IOException;
}
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsListing.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsListing.java
index 275cfa5abef1..285f30fa84fa 100644
--- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsListing.java
+++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsListing.java
@@ -23,9 +23,18 @@
import com.microsoft.azure.PagedList;
import java.io.IOException;
-import java.util.List;
-// Requires class to support listing entities
+/**
+ * Provides access to listing Azure resources of a specific type in a subscription
+ *
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsListing
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsListingByLocation
+ * (Note: this interface is not intended to be implemented by user code)
+ */
public interface SupportsUpdating
+ * This is the beginning of the builder pattern used to modify top level resources
+ * in Azure. The final method completing the update definition and starting the actual resource update
+ * process in Azure is {@link Appliable#apply()}.
+ *
+ * Note that the {@link Appliable#apply()} method is available at any stage of the update definition
+ * because all the updatable settings are generally optional.
+ * Settings typically begin
+ * with the word "with", for example:
+ *
+ * @return Authenticated Azure client
+ * @throws IOException
+ */
Authenticated authenticate(File credentialsFile) throws IOException;
}
@@ -114,11 +118,42 @@ public Authenticated authenticate(File credentialsFile) throws IOException {
}
+ /**
+ * Provides authenticated access to a subset of Azure APIs that do not require a specific subscription.
+ *
+ * To access the subscription-specific APIs, use {@link Authenticated#withSubscription(String)},
+ * or {@link Authenticated#withDefaultSubscription()} if a default subscription has already been previously specified
+ * (for example, in a previously specified authentication file).
+ * @see Azure#authenticate(File)
+ */
public interface Authenticated {
+ /**
+ * Entry point to subscription management
+ * @return Subscriptions interface providing access to subscription management
+ */
Subscriptions subscriptions();
Tenants tenants();
+
+ /**
+ * Selects a specific subscription for the APIs to work with.
+ *
+ * Most Azure APIs require a specific subscription to be selected.
+ * @param subscriptionId the ID of the subscription
+ * @return an authenticated Azure client configured to work with the specified subscription
+ */
Azure withSubscription(String subscriptionId);
- Azure withDefaultSubscription();
+
+ /**
+ * Selects the default subscription as the subscription for the APIs to work with.
+ *
+ * The default subscription can be specified inside the authentication file using {@link Azure#authenticate(File)}.
+ * If no default subscription has been previously provided, the first subscription as
+ * returned by {@link Authenticated#subscriptions()} will be selected.
+ * @return an authenticated Azure client configured to work with the default subscription
+ * @throws IOException
+ * @throws CloudException
+ */
+ Azure withDefaultSubscription() throws CloudException, IOException;
}
private static final class AuthenticatedImpl implements Authenticated {
@@ -131,8 +166,8 @@ private AuthenticatedImpl(RestClient restClient) {
this.restClient = restClient;
}
- private AuthenticatedImpl withDefaultSubscription(String subscriptionId) {
- this.defaultSubscription = subscriptionId;
+ private AuthenticatedImpl withDefaultSubscription(String subscriptionId) throws IOException {
+ this.defaultSubscription = subscriptionId;
return this;
}
@@ -152,8 +187,17 @@ public Azure withSubscription(String subscriptionId) {
}
@Override
- public Azure withDefaultSubscription() {
- return withSubscription(this.defaultSubscription);
+ public Azure withDefaultSubscription() throws CloudException, IOException {
+ if(this.defaultSubscription != null) {
+ return withSubscription(this.defaultSubscription);
+ } else {
+ PagedList.withNewResourceGroup()
and return the next stage
+ * of the resource definition, as an interface in the "fluent interface" style.
+ * @param name the name of the new resource
+ * @return the first stage of the new resource definition
+ */
T define(String name);
}
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java
index ac71e974ba58..27cc07a16a2b 100644
--- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java
+++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java
@@ -19,7 +19,16 @@
*/
package com.microsoft.azure.management.resources.fluentcore.collection;
-// Requires class to support deleting entities
+/**
+ * Provides access to deleting a resource from Azure, identifying it by its resource ID
+ * .withRegion()
and return the update definition itself, to enable chaining
+ * in the fluent interface style.
+ * @param id the resource id of the resource to update. Remember to call {@see Appliable#apply()} for the changes
+ * to go into effect on Azure.
+ * @return the update definition itself
+ */
+ T update(String id);
}
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java
index 02d793e13d0c..91e8063e12bc 100644
--- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java
+++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java
@@ -4,7 +4,6 @@
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.resources.fluentcore.model.implementation.IndexableWrapperImpl;
import com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter;
-import com.microsoft.azure.management.resources.implementation.api.SubscriptionClientImpl;
import com.microsoft.azure.management.resources.implementation.api.SubscriptionsInner;
import com.microsoft.azure.management.resources.Location;
import com.microsoft.azure.management.resources.Subscription;
diff --git a/azure-mgmt-storage/pom.xml b/azure-mgmt-storage/pom.xml
index 7c4562ab409f..10f7d0f4e229 100644
--- a/azure-mgmt-storage/pom.xml
+++ b/azure-mgmt-storage/pom.xml
@@ -35,8 +35,6 @@
+ * subscription= #subscription ID
+ * @return authenticated Azure client
* @throws IOException
+ * @throws CloudException
*/
public static Authenticated authenticate(File credentialsFile) throws IOException {
ApplicationTokenCredentials credentials = ApplicationTokenCredentials.fromFile(credentialsFile);
return new AuthenticatedImpl(AzureEnvironment.AZURE.newRestClientBuilder()
.withCredentials(credentials)
- .build())
- .withDefaultSubscription(credentials.defaultSubscriptionId());
+ .build()).withDefaultSubscription(credentials.defaultSubscriptionId());
}
+ /**
+ * Authenticates API access using a {@link RestClient} instance.
+ * @param restClient the {@link RestClient} configured with Azure authentication credentials
+ * @return authenticated Azure client
+ */
public static Authenticated authenticate(RestClient restClient) {
return new AuthenticatedImpl(restClient);
}
@@ -84,19 +95,12 @@ public interface Configurable extends AzureConfigurable
+ * tenant= #tenant ID
+ * client= #client id
+ * key= #client key
+ * managementURI= #management URI
+ * baseURL= #base URL
+ * authURL= #authentication URL
+ *