Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update API version, add MinChildEndpoints for NestedEndpoints #570

Merged
merged 1 commit into from
Dec 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.microsoft.azure.management.trafficmanager.models.EndpointUpdateResponse;
import com.microsoft.windowsazure.core.OperationResponse;
import com.microsoft.windowsazure.exception.ServiceException;

import java.io.IOException;
import java.util.concurrent.Future;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
import com.microsoft.windowsazure.core.utils.CollectionStringBuilder;
import com.microsoft.windowsazure.exception.ServiceException;
import com.microsoft.windowsazure.tracing.CloudTracing;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
Expand All @@ -48,15 +56,6 @@
import org.codehaus.jackson.node.NullNode;
import org.codehaus.jackson.node.ObjectNode;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;

/**
* Operations for managing Traffic Manager endpoints.
*/
Expand Down Expand Up @@ -180,7 +179,7 @@ public EndpointCreateOrUpdateResponse createOrUpdate(String resourceGroupName, S
url = url + "/";
url = url + URLEncoder.encode(endpointName, "UTF-8");
ArrayList<String> queryParameters = new ArrayList<String>();
queryParameters.add("api-version=" + "2015-04-28-preview");
queryParameters.add("api-version=" + "2015-11-01");
if (queryParameters.size() > 0) {
url = url + "?" + CollectionStringBuilder.join(queryParameters, "&");
}
Expand Down Expand Up @@ -252,6 +251,10 @@ public EndpointCreateOrUpdateResponse createOrUpdate(String resourceGroupName, S
if (parameters.getEndpoint().getProperties().getEndpointMonitorStatus() != null) {
((ObjectNode) propertiesValue).put("endpointMonitorStatus", parameters.getEndpoint().getProperties().getEndpointMonitorStatus());
}

if (parameters.getEndpoint().getProperties().getMinChildEndpoints() != null) {
((ObjectNode) propertiesValue).put("minChildEndpoints", parameters.getEndpoint().getProperties().getMinChildEndpoints());
}
}

StringWriter stringWriter = new StringWriter();
Expand Down Expand Up @@ -369,6 +372,13 @@ public EndpointCreateOrUpdateResponse createOrUpdate(String resourceGroupName, S
endpointMonitorStatusInstance = endpointMonitorStatusValue.getTextValue();
propertiesInstance.setEndpointMonitorStatus(endpointMonitorStatusInstance);
}

JsonNode minChildEndpointsValue = propertiesValue2.get("minChildEndpoints");
if (minChildEndpointsValue != null && minChildEndpointsValue instanceof NullNode == false) {
long minChildEndpointsInstance;
minChildEndpointsInstance = minChildEndpointsValue.getLongValue();
propertiesInstance.setMinChildEndpoints(minChildEndpointsInstance);
}
}
}

Expand Down Expand Up @@ -476,7 +486,7 @@ public OperationResponse delete(String resourceGroupName, String profileName, St
url = url + "/";
url = url + URLEncoder.encode(endpointName, "UTF-8");
ArrayList<String> queryParameters = new ArrayList<String>();
queryParameters.add("api-version=" + "2015-04-28-preview");
queryParameters.add("api-version=" + "2015-11-01");
if (queryParameters.size() > 0) {
url = url + "?" + CollectionStringBuilder.join(queryParameters, "&");
}
Expand Down Expand Up @@ -616,7 +626,7 @@ public EndpointGetResponse get(String resourceGroupName, String profileName, Str
url = url + "/";
url = url + URLEncoder.encode(endpointName, "UTF-8");
ArrayList<String> queryParameters = new ArrayList<String>();
queryParameters.add("api-version=" + "2015-04-28-preview");
queryParameters.add("api-version=" + "2015-11-01");
if (queryParameters.size() > 0) {
url = url + "?" + CollectionStringBuilder.join(queryParameters, "&");
}
Expand Down Expand Up @@ -746,6 +756,13 @@ public EndpointGetResponse get(String resourceGroupName, String profileName, Str
endpointMonitorStatusInstance = endpointMonitorStatusValue.getTextValue();
propertiesInstance.setEndpointMonitorStatus(endpointMonitorStatusInstance);
}

JsonNode minChildEndpointsValue = propertiesValue.get("minChildEndpoints");
if (minChildEndpointsValue != null && minChildEndpointsValue instanceof NullNode == false) {
long minChildEndpointsInstance;
minChildEndpointsInstance = minChildEndpointsValue.getLongValue();
propertiesInstance.setMinChildEndpoints(minChildEndpointsInstance);
}
}
}

Expand Down Expand Up @@ -864,7 +881,7 @@ public EndpointUpdateResponse update(String resourceGroupName, String profileNam
url = url + "/";
url = url + URLEncoder.encode(endpointName, "UTF-8");
ArrayList<String> queryParameters = new ArrayList<String>();
queryParameters.add("api-version=" + "2015-04-28-preview");
queryParameters.add("api-version=" + "2015-11-01");
if (queryParameters.size() > 0) {
url = url + "?" + CollectionStringBuilder.join(queryParameters, "&");
}
Expand Down Expand Up @@ -936,6 +953,10 @@ public EndpointUpdateResponse update(String resourceGroupName, String profileNam
if (parameters.getEndpoint().getProperties().getEndpointMonitorStatus() != null) {
((ObjectNode) propertiesValue).put("endpointMonitorStatus", parameters.getEndpoint().getProperties().getEndpointMonitorStatus());
}

if (parameters.getEndpoint().getProperties().getMinChildEndpoints() != null) {
((ObjectNode) propertiesValue).put("minChildEndpoints", parameters.getEndpoint().getProperties().getMinChildEndpoints());
}
}

StringWriter stringWriter = new StringWriter();
Expand Down Expand Up @@ -1053,6 +1074,13 @@ public EndpointUpdateResponse update(String resourceGroupName, String profileNam
endpointMonitorStatusInstance = endpointMonitorStatusValue.getTextValue();
propertiesInstance.setEndpointMonitorStatus(endpointMonitorStatusInstance);
}

JsonNode minChildEndpointsValue = propertiesValue2.get("minChildEndpoints");
if (minChildEndpointsValue != null && minChildEndpointsValue instanceof NullNode == false) {
long minChildEndpointsInstance;
minChildEndpointsInstance = minChildEndpointsValue.getLongValue();
propertiesInstance.setMinChildEndpoints(minChildEndpointsInstance);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.microsoft.azure.management.trafficmanager.models.ProfileUpdateResponse;
import com.microsoft.windowsazure.core.OperationResponse;
import com.microsoft.windowsazure.exception.ServiceException;

import java.io.IOException;
import java.util.concurrent.Future;

Expand Down
Loading