private async Task<HttpResponseMessage> OverwriteModel(string iLearnerPath, string endpointUrl, string apiKey, string resourceName)
{
AzureBlobDataReference InputLocation = new AzureBlobDataReference
{
FullURL = iLearnerPath
};
InputLocation.ParseFullURL();
var resourceLocations = new
{
Resources = new[]
{
new
{
Name = resourceName,
Location = InputLocation
//Location = new AzureBlobDataReference()
//{
// BaseLocation = "https://esintussouthsus.blob.core.windows.net/",
// RelativeLocation = "your endpoint relative location", //from the output, for example: “experimentoutput/8946abfd-79d6-4438-89a9-3e5d109183/8946abfd-79d6-4438-89a9-3e5d109183.ilearner”
// SasBlobToken = "your endpoint SAS blob token" //from the output, for example: “?sv=2013-08-15&sr=c&sig=37lTTfngRwxCcf94%3D&st=2015-01-30T22%3A53%3A06Z&se=2015-01-31T22%3A58%3A06Z&sp=rl”
//}
}
}
};
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
using (var request = new HttpRequestMessage(new HttpMethod("PATCH"), endpointUrl))
{
request.Content = new StringContent(JsonConvert.SerializeObject(resourceLocations), System.Text.Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.SendAsync(request);
//if (!response.IsSuccessStatusCode)
//{
// //await WriteFailedResponse(response);
//}
return response;
}
}
}