Skip to content

Instantly share code, notes, and snippets.

View Lutando's full-sized avatar
💻
developing.

Lutando Ngqakaza Lutando

💻
developing.
View GitHub Profile
@Lutando
Lutando / akkatecture logs
Created August 7, 2019 08:03
test problem logs
Akkatecture.Tests.UnitTests.Jobs.ScheduledJobsTests.SchedulingJob_For5minutes_DispatchesJobMessage
Failed: Expected no messages during 00:00:01, instead we received <Akkatecture.TestHelpers.Jobs.TestJobDone> from [akka://jobs-tests/user/$a/test-job-runner-supervisor/test-job-runner#1730104005] after 00:00:00.0000030
Expected: True
Actual: False
at Akka.TestKit.TestKitBase.InternalExpectNoMsg(TimeSpan duration)
at Akka.TestKit.TestKitBase.ExpectNoMsg(TimeSpan duration)
at Akkatecture.Tests.UnitTests.Jobs.ScheduledJobsTests.SchedulingJob_For5minutes_DispatchesJobMessage() in /Users/lutandongqakaza/Workspace/Akkatecture/Akkatecture/test/Akkatecture.Tests/UnitTests/Jobs/ScheduledJobsTests.cs:line 89
$resourceGroupName = "<the-rg-name>"
$apimServiceName = "<the-apim-servcie-name>"
$apiSpecificationPath = "some/path/to/spec.json"
$apiName = "<the-api-name>"
# lets get the API Management context
$apiManagementContextParams = @{
ResourceGroupName = $resourceGroupName
ServiceName = $apimServiceName
}
$apiManagementContext = New-AzApiManagementContext @apiManagementContextParams
$apiSpecifications = Get-AzApiManagementApi -Context $apiManagementContext
#now we filter out the specification object that we want
$apiSpecification = $apiSpecifications | Where-Object { $_.Name -eq $apiName }
# increment the revision based off the current revision number
$newRevision = [int]$apiSpecification.ApiRevision + 1;
# now lets create an api revision
$newApiRevisionParams = @{
Context = $apiManagementContext
ApiId = $apiSpecification.ApiId
ApiRevision = $newRevision
SourceApiRevision = $apiSpecification.ApiRevision
}
# we make a new schema
$newApiManagementSchemaParams = @{
Context = $ApiManagementContext
ApiId = $newApiRevision.ApiId
SchemaDocumentContentType = "application/json"
SchemaDocumentFilePath = $apiSpecificationPath
}
New-AzApiManagementApiSchema @newApiManagementSchemaParams