directory
Version:
v0.0.0-...-0cd9b86
Opens a new window with list of versions in this module.
Published: Oct 14, 2024
License: Apache-2.0
Opens a new window with license information.
README
¶
= How to run
[source, bash]
.*Run From Source Code*
----
go mod init github.com/kylinsoong/golang/nim-mock
go mod tidy
go run cmd/nim-mock/main.go --tls-certificate=$(pwd)/cert/certificate.crt --tls-private=$(pwd)/cert/private.key
----
[source, bash]
.*Build Source Code & Run locally*
----
go mod init github.com/kylinsoong/golang/nim-mock
go mod tidy
go build -o nim-mock -ldflags "-X main.version=1.0.0" cmd/nim-mock/*.go
./nim-mock --tls-certificate=$(pwd)/cert/certificate.crt --tls-private=$(pwd)/cert/private.key
----
[source, bash]
.*Build Source Code to Docker Image & Run locally*
----
docker build -t cloudadc/nim-mock:0.1 -f Dockerfile .
docker run -it --rm -p 443:443 cloudadc/nim-mock:0.1
// build docker image & run (arm64)
docker build -t cloudadc/nim-mock:0.1-arm64 -f Dockerfile.arm64 .
docker run -it --rm -p 443:443 cloudadc/nim-mock:0.1-arm64
----
== Supported API
=== /api/platform/v1/instance-groups/summary
[source, bash]
----
curl -k -s -u "admin:admin" -X GET https://127.0.0.1/api/platform/v1/instance-groups/summary -H "accept: application/json"
----
=== /api/platform/v1/instance-groups/{uid}/config
[source, bash]
.*POST*
----
curl -k -s -u "admin:admin" -X POST https://127.0.0.1/api/platform/v1/instance-groups/c78208d2-f017-4a48-bab9-f2dc2432b8c9/config -H "accept: application/json" -H 'Content-Type: application/json' -d "@config.json"
----
[source, bash]
.*GET*
----
curl -k -s -u "admin:admin" -X GET https://127.0.0.1/api/platform/v1/instance-groups/c78208d2-f017-4a48-bab9-f2dc2432b8c9/config -H "accept: application/json"
----
=== /api/platform/v1/instance-groups/deployments/{uid}
[source, bash]
.*GET*
----
curl -k -s -u "admin:admin" -X GET https://127.0.0.1/api/platform/v1/instance-groups/deployments/09aa57d6-bff8-437e-9796-4f5308c454b0 -H "accept: application/json"
----
Click to show internal directories.
Click to hide internal directories.