Skip to content

Fixing issue with AzureEndpoints. #975

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

Merged
merged 1 commit into from
Sep 25, 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 @@ -20,6 +20,8 @@ namespace Microsoft.Azure.Commands.TrafficManager.Models

public class TrafficManagerEndpoint
{
public string Id { get; set; }

public string Name { get; set; }

public string ProfileName { get; set; }
Expand All @@ -46,16 +48,17 @@ public Endpoint ToSDKEndpoint()
{
return new Endpoint
{
Id = this.Id,
Name = this.Name,
Type = TrafficManagerEndpoint.ToSDKEndpointType(this.Type),
Id = this.TargetResourceId,
Properties = new EndpointProperties
{
Target = this.Target,
EndpointStatus = this.EndpointStatus,
Weight = this.Weight,
Priority = this.Priority,
EndpointLocation = this.Location
EndpointLocation = this.Location,
TargetResourceId = this.TargetResourceId
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public TrafficManagerEndpoint CreateTrafficManagerEndpoint(string resourceGroupN
}
});

return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(resourceGroupName, profileName, endpointType, endpointName, response.Endpoint.Properties);
return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(response.Endpoint.Id, resourceGroupName, profileName, endpointType, endpointName, response.Endpoint.Properties);
}

public TrafficManagerProfile GetTrafficManagerProfile(string resourceGroupName, string profileName)
Expand All @@ -120,6 +120,7 @@ public TrafficManagerEndpoint GetTrafficManagerEndpoint(string resourceGroupName
EndpointGetResponse response = this.TrafficManagerManagementClient.Endpoints.Get(resourceGroupName, profileName, endpointType, endpointName);

return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(
response.Endpoint.Id,
resourceGroupName,
profileName,
endpointType,
Expand Down Expand Up @@ -171,6 +172,7 @@ public TrafficManagerEndpoint SetTrafficManagerEndpoint(TrafficManagerEndpoint e
parameters);

return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(
endpoint.Id,
endpoint.ResourceGroupName,
endpoint.ProfileName,
endpoint.Type,
Expand Down Expand Up @@ -285,10 +287,11 @@ private static string ExtractResourceGroupFromId(string id)
return id.Split('/')[4];
}

private static TrafficManagerEndpoint GetPowershellTrafficManagerEndpoint(string resourceGroupName, string profileName, string endpointType, string endpointName, EndpointProperties mamlEndpointProperties)
private static TrafficManagerEndpoint GetPowershellTrafficManagerEndpoint(string id, string resourceGroupName, string profileName, string endpointType, string endpointName, EndpointProperties mamlEndpointProperties)
{
return new TrafficManagerEndpoint
{
Id = id,
ResourceGroupName = resourceGroupName,
ProfileName = profileName,
Name = endpointName,
Expand Down