Azure-Samples / azure-sdk-for-go-samples

Examples of how to utilize Azure services from Go.
MIT License
296 stars 184 forks source link

Added example for the API Mangement service #260

Open WilliamMortlMicrosoft opened 5 years ago

WilliamMortlMicrosoft commented 5 years ago

This PR adds an additional example for this repo that demonstrates how to add/delete an API Management Service as well as add/delete an API endpoint within the service.

NOTE: this test takes a VERY long time to run (~60m) due to the speed (or lack thereof) with which Azure creates an API Management service instance.

WilliamMortlMicrosoft commented 5 years ago

Successful test run example:

Williams-MBP:apimgmt wmortl$ go test -timeout 60m 2019/08/29 15:06:01 creating resource group 'azure-samples-go-APIMSTest-jVhoN' on location: eastus2 2019/08/29 15:06:07 creating api management service... creating api management service... 2019/08/29 15:45:19 api management service created api management service created 2019/08/29 15:45:19 creating api endpoint... creating api endpoint... 2019/08/29 15:46:28 open api endpoint created open api endpoint created 2019/08/29 15:46:28 deleting the api endpoint... deleting the api endpoint... 2019/08/29 15:46:31 open api endpoint deleted open api endpoint deleted 2019/08/29 15:48:33 api management service deleted api management service deleted 2019/08/29 15:48:33 deleting resources PASS ok github.com/WilliamMortlMicrosoft/azure-sdk-for-go-samples/apimgmt 2554.421s

WilliamMortlMicrosoft commented 5 years ago

The test is set to t.SkipNow() due to the length of it running... that line can be commented out in order to run it manually. This test takes too long to be part of a continuous integration pipeline.

WilliamMortlMicrosoft commented 5 years ago

Please fix the build error, it is not due to this PR:


WARNING: failed to install github.com/golang/lint/golint: exit status 1

gometalinter: error: failed to install the following linters: github.com/golang/lint/golint

WARNING: exec: "golint": executable file not found in $PATH

done linting.

building...

github.com/Azure-Samples/azure-sdk-for-go-samples/web

github.com/Azure-Samples/azure-sdk-for-go-samples/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web

github.com/Azure-Samples/azure-sdk-for-go-samples/web

done building.

ISPR: 1

Makefile:2: recipe for target 'test' failed

make: *** [test] Error 1```