Sign inSign up

getdtk/controller-manager-api

By getdtk

Updated about 6 years ago

Image
0

2.4K

getdtk/controller-manager-api repository overview

Setup

First build config-generator gem and install it. Currently latest code for config-generator gem is under https://github.com/dtk/kube-crd-parsers/tree/master-candidate/tests/config-generator/assets

Clone kube-crd-parser from link above
cd kube-crd-parsers/tests/config-generator/assets
gem build config-driver.gemspec
gem install config-driver-0.0.1.gem

After config-driver gem is installed, you can run sinatra api with:

rackup config.ru

End to end example

First make sure that valid attributes are set in input params.yaml file. For that you can use script:

cd kube-crd-parsers/tests/config-generator/assets/end-to-end
bash replace_stubbed_values.sh -r us-east-1 -v vpcid1 -c cidrblock1 -h "{t1:1,t2:2}"

If you need to set additional attributes for any of the components in assembly you can do that under assemblies -> assembly_name -> components in base component_def meta file, e.g.:

kube-crd-parsers/tests/config-generator/assets/end-to-end/config/aws_vpc/target/meta.yaml#L28

Try out end to end example:

  1. start sinatra api application as described above.

  2. curl endpoint to generate crds and apply to kubernetes Note that you can change parent_dir parameter to point to directory where config and input directories are located. For this example you can leave it as is.

curl -X POST http://localhost:9292/generate-crds -H "Content-Type: application/json" -d '{"parent_dir":"kube-crd-parsers/tests/config-generator/assets/end-to-end"}'

Currently supported endpoints

Assembly

Get assembly

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name> -H "Content-Type: application/json"


Get single component from assembly

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name> -H "Content-Type: application/json"


Get attributes from single component from assembly

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name>/attributes -H "Content-Type: application/json"


Get attributes metadata from single component from assembly

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name>/attributes?filter=metadata -H "Content-Type: application/json"


Get attribute values from single component from assembly

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name>/attributes?filter=values -H "Content-Type: application/json"


Workflow Instance

Get workflow instance

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name> -H "Content-Type: application/json"


Get workflow instance execution status

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/status -H "Content-Type: application/json"


Get workflow instance steps

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/steps -H "Content-Type: application/json"


Get workflow instance attributes

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/attributes -H "Content-Type: application/json"


Get attributes metadata from workflow instance

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/attributes?filter=metadata -H "Content-Type: application/json"


Get attribute values from workflow instance

curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/attributes?filter=values -H "Content-Type: application/json"


Create workflow instance from workflow

curl -X POST http://localhost:9292/workflow-instance -H "Content-Type: application/json" -d '{"template_name":"<workflow_name>", "namespace":"<namespace_name>", "name":"<workflow_instance_name>"}'

Tag summary

Content type

Image

Digest

Size

168.4 MB

Last updated

over 6 years ago

docker pull getdtk/controller-manager-api