Skip to content

Commit

Permalink
Merge pull request #1184 from anuchandy/tm
Browse files Browse the repository at this point in the history
Completed Traffic manager Profiles, endpoints CRUD
  • Loading branch information
Martin Sawicki authored Oct 18, 2016
2 parents 7d5f4ac + f202ab8 commit 8c2d93b
Show file tree
Hide file tree
Showing 42 changed files with 5,484 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.ResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.fluentcore.model.Creatable;

/**
Expand All @@ -23,10 +24,11 @@ public interface GroupableResource extends Resource {
/**
* Grouping of all the definition stages.
*/

interface DefinitionStages {
/**
* A resource definition allowing a resource group to be selected.
* <p>
* Region of the groupable resource will be used for new resource group
*
* @param <T> the next stage of the resource definition
*/
Expand All @@ -36,11 +38,25 @@ interface WithGroup<T> extends
}

/**
* A resource definition allowing a new resource group to be created.
* A resource definition allowing a resource group to be selected.
* <p>
* Region has to be specified explicitly to create a new resource group
*
* @param <T> the next stage of the resource definition
*/
interface WithNewResourceGroup<T> {
interface WithGroupAndRegion<T> extends
WithExistingResourceGroup<T>,
WithNewResourceGroupWithRegion<T> {
}

/**
* A resource definition allowing a new resource group to be created in the same
* region as groupable resource.
*
* @param <T> the next stage of the resource definition
*/
interface WithNewResourceGroup<T> extends
WithCreatableResourceGroup<T> {
/**
* Creates a new resource group to put the resource in.
* <p>
Expand All @@ -58,7 +74,45 @@ interface WithNewResourceGroup<T> {
* @return the next stage of the resource definition
*/
T withNewResourceGroup();
}

/**
* A resource definition allowing a new resource group to be created in a different
* region .
*
* @param <T> the next stage of the resource definition
*/
interface WithNewResourceGroupWithRegion<T> extends
WithCreatableResourceGroup<T> {
/**
* Creates a new resource group to put the resource in.
* <p>
* The group will be created in the same location as the resource.
*
* @param name the name of the new group
* @param region the region where resource group needs to be created
* @return the next stage of the resource definition
*/
T withNewResourceGroup(String name, Region region);

/**
* Creates a new resource group to put the resource in.
* <p>
* The group will be created in the same location as the resource.
* The group's name is automatically derived from the resource's name.
*
* @param region the region where resource group needs to be created
* @return the next stage of the resource definition
*/
T withNewResourceGroup(Region region);
}

/**
* A resource definition allowing a new creatable resource group to be specified.
*
* @param <T> the next stage of the resource definition
*/
interface WithCreatableResourceGroup<T> {
/**
* Creates a new resource group to put the resource in, based on the definition specified.
* @param groupDefinition a creatable definition for a new resource group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.microsoft.azure.management.resources.fluentcore.arm.models.implementation;

import com.microsoft.azure.management.resources.ResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils;
import com.microsoft.azure.management.resources.fluentcore.arm.implementation.ManagerBase;
import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource;
Expand Down Expand Up @@ -82,6 +83,20 @@ public final FluentModelImplT withNewResourceGroup(String groupName) {
this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(this.regionName()));
}

/**
* Creates a new resource group to put the resource in.
* <p>
* The group will be created in the same location as the resource.
*
* @param groupName the name of the new group
* @param region the region where resource group needs to be created
* @return the next stage of the resource definition
*/
public final FluentModelImplT withNewResourceGroup(String groupName, Region region) {
return this.withNewResourceGroup(
this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(region));
}

/**
* Creates a new resource group to put the resource in.
* <p>
Expand All @@ -93,6 +108,19 @@ public final FluentModelImplT withNewResourceGroup() {
return this.withNewResourceGroup(this.name() + "group");
}

/**
* Creates a new resource group to put the resource in.
* <p>
* The group will be created in the same location as the resource.
* The group's name is automatically derived from the resource's name.
*
* @param region the region where resource group needs to be created
* @return the next stage of the resource definition
*/
public final FluentModelImplT withNewResourceGroup(Region region) {
return this.withNewResourceGroup(this.name() + "group", region);
}

/**
* Creates a new resource group to put the resource in, based on the definition specified.
* @param creatable a creatable definition for a new resource group
Expand Down
136 changes: 136 additions & 0 deletions azure-mgmt-trafficmanager/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-parent</artifactId>
<version>1.0.0-beta4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>azure-mgmt-trafficmanager</artifactId>
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Traffic Manager Management</name>
<description>This package contains Microsoft Azure Traffic Manager Management SDK.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>

<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.0.0-beta3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
<version>1.0.0-beta4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.0.0-beta3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-storage</artifactId>
<version>1.0.0-beta4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>api-annotations</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<annotationProcessors>
<annotationProcessor>
com.microsoft.azure.management.apigeneration.LangDefinitionProcessor</annotationProcessor>
</annotationProcessors>
<debug>true</debug>
<optimize>true</optimize>
<compilerArguments>
<AaddGeneratedAnnotation>true</AaddGeneratedAnnotation>
<Adebug>true</Adebug>
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.trafficmanager;

import com.microsoft.azure.management.trafficmanager.implementation.TrafficManagerNameAvailabilityInner;

/**
* The {@link com.microsoft.azure.management.trafficmanager.TrafficManagerProfiles#checkDnsNameAvailability} action result.
*/
public class CheckProfileDnsNameAvailabilityResult {
private TrafficManagerNameAvailabilityInner inner;

/**
* Creates an instance of CheckProfileDnsNameAvailabilityResult.
*
* @param inner the inner object
*/
public CheckProfileDnsNameAvailabilityResult(TrafficManagerNameAvailabilityInner inner) {
this.inner = inner;
}

/**
* @return true if the DNS name is available to use, false if the name has already been taken
* or invalid and cannot be used.
*/
public boolean isAvailable() {
return inner.nameAvailable();
}

/**
* @return the reason that the DNS name could not be used
*/
public ProfileDnsNameUnavailableReason reason() {
return new ProfileDnsNameUnavailableReason(inner.reason());
}

/**
* @return an error message explaining the reason value in more detail
*/
public String message() {
return inner.message();
}
}
Loading

0 comments on commit 8c2d93b

Please sign in to comment.