commit | 5d41aa8d25a5a85d20e2b55a25c111baec656f9f | [log] [tgz] |
---|---|---|
author | Rajanish GJ <rajanishgj@google.com> | Mon Jun 26 14:49:51 2017 -0700 |
committer | GitHub <noreply@github.com> | Mon Jun 26 14:49:51 2017 -0700 |
tree | 53b76bf87cf49fa09a83fded97ec8afa114f4ee9 | |
parent | 2b48cfa84a54e1b173c5d86ab5db9751d888cffc [diff] | |
parent | 346c573f8957e262ff7c2e27f263f2cb7593d082 [diff] |
Merge pull request #26 from 30x/XAPID-1016 [XAPID-1016] fix unsupported timestamp format
This core plugin for apid responds to apidApigeeSync events and publishes an API that allows clients to deploy and update a locally configured gateway.
This plugin simply tracks counters based on called URIs:
GET /deployments/
- retrieve current deploymentPOST /deployments/
- update deploymentsSee apidGatewayDeploy-api.yaml for full spec.
Window of time during which deployment changes are gathered before sending to client. Default: “bundles”
Duration between deleting a deployment and deleting it's bundles on disk. Default: “1s”
Duration before a bundle download connection terminates
Default: “5m”
Duration before bundle download marks deployment as failed (will continue download retries regardless). Default: “10m”
Relative location from local_storage_path in which to store local bundle files. Default: “5m”
(durations note, see: https://golang.org/pkg/time/#ParseDuration)
First, install prerequisites:
glide install
To run an apid test instance with just this plugin installed, change to the cmd/apidGatewayDeploy
folder. From here, you may create an executable with:
go build
Alternatively, you may run without creating an executable with:
go run main.go
Command line options:
If you use the -deployments
option, the server will start using a clean database that contains only the deployments contained in the file specified.
The file should be the JSON for an array of deployments. JSON format is:
[ { "id": "", "scopeId": "", "created": "", "createdBy": "", "updated": "", "updatedBy": "", "configuration": { "key": "value" }, "bundleConfiguration": { "key": "value" }, "displayName": "", "uri": "" } ]
Notes:
Once the process is running, you should be able to manually give the plugin's API a whirl...
curl -i localhost:9000/deployments/ curl -i -X POST localhost:9000/deployments -d '{ ... }'
The following may be interesting env vars for configuration:
To run the tests, just run:
go test
To generate coverage, you may run:
./cover.sh
Then open cover.html
with your browser to see details.