From a9caaeacb9a8aefae494c46fa59f0a7a75f1e233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Opasiak?= Date: Tue, 4 Jun 2024 10:22:32 +0100 Subject: [PATCH] provider: add members resource --- .gitignore | 2 +- docs/resources/organization_member.md | 26 + generator_config.yml | 16 + go.mod | 32 +- go.sum | 69 +- openapi.yaml | 5071 ++++++++--------- out_code_spec.json | 85 + provider/external_backend_resource.go | 15 +- provider/organization_member_resource.go | 197 + provider/provider.go | 1 + .../organization_member_resource_gen.go | 57 + 11 files changed, 2922 insertions(+), 2649 deletions(-) create mode 100644 docs/resources/organization_member.md create mode 100644 provider/organization_member_resource.go create mode 100644 resource_organization_member/organization_member_resource_gen.go diff --git a/.gitignore b/.gitignore index 2d97ed5..c5e66e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ *.tfstate* main.tf -tflocal.env +*.env diff --git a/docs/resources/organization_member.md b/docs/resources/organization_member.md new file mode 100644 index 0000000..a07be53 --- /dev/null +++ b/docs/resources/organization_member.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "cycloid_organization_member Resource - terraform-provider-cycloid" +subcategory: "" +description: |- + +--- + +# cycloid_organization_member (Resource) + + + + + + +## Schema + +### Required + +- `email` (String) Invite user by email +- `role_canonical` (String) The canonical of an entity + +### Optional + +- `member_id` (Number) A member id +- `organization_canonical` (String) A canonical of an organization. diff --git a/generator_config.yml b/generator_config.yml index 8b0a729..5e56311 100644 --- a/generator_config.yml +++ b/generator_config.yml @@ -89,3 +89,19 @@ resources: - page_index - page_size - data + organization_member: + create: + path: /organizations/{organization_canonical}/members + method: POST + read: + path: /organizations/{organization_canonical}/members/{member_id} + method: GET + update: + path: /organizations/{organization_canonical}/members/{member_id} + method: PUT + delete: + path: /organizations/{organization_canonical}/members/{member_id} + method: DELETE + schema: + ignores: + - data diff --git a/go.mod b/go.mod index 71ae53c..fcec6b5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 toolchain go1.22.1 require ( - github.com/cycloidio/cycloid-cli v1.0.98-0.20240416131108-4c54dd7506a2 + github.com/cycloidio/cycloid-cli v1.0.98-0.20240715144812-df582231c38d github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 @@ -14,11 +14,12 @@ require ( ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/adrg/xdg v0.4.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/fatih/color v1.14.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.23.0 // indirect github.com/go-openapi/errors v0.22.0 // indirect @@ -45,37 +46,40 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml/v2 v2.2.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/sagikazarmark/locafero v0.5.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.18.2 // indirect + github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect - go.opentelemetry.io/otel v1.25.0 // indirect - go.opentelemetry.io/otel/metric v1.25.0 // indirect - go.opentelemetry.io/otel/trace v1.25.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect + golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect - google.golang.org/grpc v1.60.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect + google.golang.org/grpc v1.62.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5bd5f60..03eb0c0 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -5,8 +7,13 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:W github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cycloidio/cycloid-cli v1.0.98-0.20240416131108-4c54dd7506a2 h1:ldd4MSg9BYS4t45h1Zm8+nakiFR8umJwZRwdKNqYBtA= -github.com/cycloidio/cycloid-cli v1.0.98-0.20240416131108-4c54dd7506a2/go.mod h1:ZD91IPcZE/7AuQuov1oEWPif7Jx2MJduC5P2e2k581U= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240603082218-76feb2dba502 h1:ipd4MyowL1cckUoUg2G5ot97lRb4AZ123OxvtMC0eqA= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240603082218-76feb2dba502/go.mod h1:ZD91IPcZE/7AuQuov1oEWPif7Jx2MJduC5P2e2k581U= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240604091212-1cb85d243d40/go.mod h1:ZD91IPcZE/7AuQuov1oEWPif7Jx2MJduC5P2e2k581U= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240715103734-fec9c80754a0 h1:8/NQbiO3T6iVqCFbBbq9H8Pj+7oSlbexFteJYxA+ryU= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240715103734-fec9c80754a0/go.mod h1:Yebeh6QvBboW35t3EAffyJ+4AT+6FL9J5Krj4sRHFyo= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240715144812-df582231c38d h1:bs/DdugKPGiz79ReMmnq3GXKqbvufQVwnnJ+LO6XN8M= +github.com/cycloidio/cycloid-cli v1.0.98-0.20240715144812-df582231c38d/go.mod h1:Yebeh6QvBboW35t3EAffyJ+4AT+6FL9J5Krj4sRHFyo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -19,8 +26,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= @@ -96,6 +103,9 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -104,20 +114,27 @@ github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg= -github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/locafero v0.5.0 h1:zXz2JnQDgE5gDg0R9ThkNT0orQzm47i8IuO6hk6XSYY= +github.com/sagikazarmark/locafero v0.5.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -130,8 +147,8 @@ github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -152,18 +169,18 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= -go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k= -go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg= -go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA= -go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM= -go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc h1:O9NuF4s+E/PvMIy+9IUZB9znFwUIXEWSstNjek6VpVg= +golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= @@ -175,19 +192,19 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/openapi.yaml b/openapi.yaml index 2174ff9..884e8a1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -14632,13 +14632,49 @@ paths: code: Unexpected security: [] x-codegen-request-body-name: body - /organizations/{organization_canonical}/invitations: + /organizations/{organization_canonical}/kpis: get: tags: - - Organization Invitations - description: Get list of the Organization's Invitations. - operationId: getInvitations + - Organization kpis + description: Get the list of configured organization KPIs + operationId: getKpis parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: project + in: query + description: A canonical of a project used for filtering. + schema: + $ref: '#/components/schemas/Canonical' + - name: environment + in: query + description: The environment canonical to use a query filter + schema: + $ref: '#/components/schemas/EnvironmentCanonical' + - name: begin + in: query + description: "The unix timestamp in seconds, which indicate the start of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: end + in: query + description: "The unix timestamp in seconds, which indicate the end of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: fetch_data + in: query + description: | + Flag to retrieve KPIs' data upon retrieving KPIs themselves + schema: + type: boolean - name: page_index in: query description: The page number to request. The first page is 1. @@ -14653,111 +14689,150 @@ paths: type: integer format: uint32 default: 1000 - - name: order_by + - name: favorite in: query description: | - Allows to order the list of items. Example usage: field_name:asc - schema: - type: string - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: invitation_created_at - in: query - description: Search by Invitation's creation date - schema: - type: integer - format: uint64 - - name: invitation_state - in: query - description: Search by Invitation's state + Flag to retrieve favorite data from the members favorite list. schema: - type: string - enum: - - accepted - - pending - - declined + type: boolean responses: "200": - description: List of the Organization's Invitations. + description: The list of the KPIs content: application/json: schema: required: - data - - pagination type: object properties: data: type: array items: - $ref: '#/components/schemas/Invitation' + $ref: '#/components/schemas/KPI' pagination: $ref: '#/components/schemas/Pagination' example: data: - id: 1 + name: My KPI 1 + canonical: my-kpi-1 + type: buildavgtime + widget: doughnut + description: This KPI shows the code coverage of your code on an + environment + project_canonical: project1 + environment_canonical: env1 + pipeline_name: pipeline1 + job_name: job1 + data_set: + - - date + - time + - - 1607904000 + - 39 + - - 1607817600 + - 140 + created_at: 1503224026 + updated_at: 1503224526 + error: Something went wrong while importing + favorite: true + - id: 2 + name: My KPI 2 + canonical: my-kpi-2 + type: timetorelease + widget: line + conf: + envs: + - staging + - preprod + - prod + description: This KPI shows how long time passes between deployment + on your different environment + project_canonical: project2 + data_set: + - - date + - env + - version + - duration + - final + - released + - - 1592100100 + - dev + - v1 + - 50 + - false + - true + - - 1592100280 + - dev + - v2 + - 95 + - false + - true + - - 1592100500 + - dev + - v3 + - 160 + - false + - true + - - 1592101700 + - dev + - v4 + - 0 + - false + - false + - - 1592100150 + - staging + - v1 + - 850 + - false + - true + - - 1592100375 + - staging + - v2 + - 625 + - false + - true + - - 1592100660 + - staging + - v3 + - 340 + - false + - true + - - 1592101000 + - prod + - v3 + - 0 + - true + - false + created_at: 1503227026 + updated_at: 1503227526 + error: "" + favorite: true + - id: 10 + name: My KPI 10 + canonical: my-kpi-10 + type: codecoverage + widget: doughnut + description: This KPI shows the code coverage of your code on an + environment + project_canonical: project2 + environment_canonical: env2 + pipeline_name: "" + job_name: "" + data_set: + - - date + - coverage + - - 1592100100 + - 13.4 + - - 1592100150 + - 28.0 + - - 1592100280 + - 85.2 + - - 1592100375 + - 83.9 created_at: 1503225026 - updated_at: 1503335026 - state: pending - email: superuser@company.com - resent_at: 1503225040 - invitee: - id: 99 - created_at: 1503225026 - updated_at: 1503225026 - username: superuser - given_name: Owen - family_name: Smith - emails: - - superuser@company.com - last_login: 1503225026 - locale: en - invited_by: - id: 99 - username: superuser - given_name: Owen - family_name: Smith - email: superuser@company.com - created_at: 1503225026 - role: - id: 22 - name: Organization Admin - description: Can manage organization's projects - policies: - - id: 33 - code: organization:project:update - description: can update the organization's projects - - id: 32 - code: organization:project:delete - description: can delete the organization's projects - role: - id: 3 - name: Developer - description: A developer of the Organization - policies: - - id: 21 - code: team:read - entities: - - "1" - - "12" - - "42" - description: Grant the access to read the teams of an organization - - id: 42 - code: member:read - entities: [] - description: Grant the access to read the members - - id: 60 - code: project:read - entities: [] - description: Grant the access to projects - pagination: - index: 1 - size: 10 - total: 1 + updated_at: 1503225526 + error: "" + favorite: false "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -14775,23 +14850,6 @@ paths: errors: - message: Not enough permissions to perform the operation code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity "422": description: All the custom errors that are generated from the Cycloid API headers: @@ -14825,52 +14883,139 @@ paths: errors: - message: Server Internal error code: Unexpected - /invitations/{verification_token}: - get: + post: tags: - - Organization Invitations - description: Get the email address used for the pending invitation - operationId: getPendingInvitation + - Organization kpis + description: Save information about the KPI + operationId: createKpi parameters: - - name: verification_token + - name: organization_canonical in: path - description: "A token for verifying emails, invitations, etc." + description: A canonical of an organization. required: true schema: - minLength: 5 - type: string - responses: - "200": - description: The email address used for the pending invitation - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/PendingInvite' - example: - data: - email: user@user.com - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 + $ref: '#/components/schemas/Canonical' + - name: project + in: query + description: A canonical of a project used for filtering. + schema: + $ref: '#/components/schemas/Canonical' + - name: environment + in: query + description: The environment canonical to use a query filter + schema: + $ref: '#/components/schemas/EnvironmentCanonical' + - name: begin + in: query + description: "The unix timestamp in seconds, which indicate the start of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: end + in: query + description: "The unix timestamp in seconds, which indicate the end of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: fetch_data + in: query + description: | + Flag to retrieve KPIs' data upon retrieving KPIs themselves + schema: + type: boolean + - name: page_index + in: query + description: The page number to request. The first page is 1. + schema: + type: integer + format: uint32 + default: 1 + - name: page_size + in: query + description: The number of items at most which the response can have. + schema: + type: integer + format: uint32 + default: 1000 + - name: favorite + in: query + description: | + Flag to retrieve favorite data from the members favorite list. + schema: + type: boolean + requestBody: + description: The information of the KPI + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/NewKPI' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/NewKPI' + required: true + responses: + "200": + description: KPI has been configured + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/KPI' + example: + data: + id: 1 + name: My KPI 1 + canonical: my-kpi-1 + type: buildavgtime + widget: doughnut + description: This KPI shows the code coverage of your code on an + environment + project_canonical: project1 + environment_canonical: env1 + pipeline_name: pipeline1 + job_name: job1 + created_at: 1503224026 + updated_at: 1503224526 + error: Something went wrong while importing + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 content: application/json: schema: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Entity not found - code: NotFoundEntity + - message: Not enough permissions to perform the operation + code: Unauthorized + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -14888,14 +15033,13 @@ paths: errors: - message: Server Internal error code: Unexpected - security: [] - /organizations/{organization_canonical}/invitations/{invitation_id}/resend: - put: + x-codegen-request-body-name: body + /organizations/{organization_canonical}/kpis/{kpi_canonical}/favorites: + post: tags: - - Organization Invitations - description: Resend the email containing the verification token to accept the - Invitation. - operationId: resendInvitation + - Organization kpis + description: Add a kpi in the user favorites list. + operationId: createKPIFavorite parameters: - name: organization_canonical in: path @@ -14903,16 +15047,15 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: invitation_id + - name: kpi_canonical in: path - description: Organization Invitation id. + description: A canonical of a kpi. required: true schema: - type: integer - format: uint32 + $ref: '#/components/schemas/Canonical' responses: "204": - description: The Invitation has been resent. + description: The kpi has been added to user favorites list. content: {} "403": description: "The authenticated user cannot perform the operation because,\ @@ -14948,6 +15091,22 @@ paths: errors: - message: Entity not found code: NotFoundEntity + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -14965,13 +15124,11 @@ paths: errors: - message: Server Internal error code: Unexpected - security: [] - /organizations/{organization_canonical}/invitations/{invitation_id}: delete: tags: - - Organization Invitations - description: Delete an Organization's Invitation. - operationId: deleteInvitation + - Organization kpis + description: Remove a kpi from the user favorites list. + operationId: deleteKPIFavorite parameters: - name: organization_canonical in: path @@ -14979,16 +15136,15 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: invitation_id + - name: kpi_canonical in: path - description: Organization Invitation id. + description: A canonical of a kpi. required: true schema: - type: integer - format: uint32 + $ref: '#/components/schemas/Canonical' responses: "204": - description: Invitation has been deleted. + description: The kpi has been removed from user favorites list. content: {} "403": description: "The authenticated user cannot perform the operation because,\ @@ -15041,12 +15197,12 @@ paths: errors: - message: Server Internal error code: Unexpected - /organizations/{organization_canonical}/kpis: + /organizations/{organization_canonical}/kpis/{kpi_canonical}: get: tags: - Organization kpis - description: Get the list of configured organization KPIs - operationId: getKpis + description: Get the KPI + operationId: getKpi parameters: - name: organization_canonical in: path @@ -15054,16 +15210,12 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: project - in: query - description: A canonical of a project used for filtering. + - name: kpi_canonical + in: path + description: A canonical of a kpi. + required: true schema: $ref: '#/components/schemas/Canonical' - - name: environment - in: query - description: The environment canonical to use a query filter - schema: - $ref: '#/components/schemas/EnvironmentCanonical' - name: begin in: query description: "The unix timestamp in seconds, which indicate the start of the\ @@ -15084,29 +15236,9 @@ paths: Flag to retrieve KPIs' data upon retrieving KPIs themselves schema: type: boolean - - name: page_index - in: query - description: The page number to request. The first page is 1. - schema: - type: integer - format: uint32 - default: 1 - - name: page_size - in: query - description: The number of items at most which the response can have. - schema: - type: integer - format: uint32 - default: 1000 - - name: favorite - in: query - description: | - Flag to retrieve favorite data from the members favorite list. - schema: - type: boolean responses: "200": - description: The list of the KPIs + description: The KPI content: application/json: schema: @@ -15115,14 +15247,10 @@ paths: type: object properties: data: - type: array - items: - $ref: '#/components/schemas/KPI' - pagination: - $ref: '#/components/schemas/Pagination' + $ref: '#/components/schemas/KPI' example: data: - - id: 1 + id: 1 name: My KPI 1 canonical: my-kpi-1 type: buildavgtime @@ -15142,256 +15270,7 @@ paths: - 140 created_at: 1503224026 updated_at: 1503224526 - error: Something went wrong while importing - favorite: true - - id: 2 - name: My KPI 2 - canonical: my-kpi-2 - type: timetorelease - widget: line - conf: - envs: - - staging - - preprod - - prod - description: This KPI shows how long time passes between deployment - on your different environment - project_canonical: project2 - data_set: - - - date - - env - - version - - duration - - final - - released - - - 1592100100 - - dev - - v1 - - 50 - - false - - true - - - 1592100280 - - dev - - v2 - - 95 - - false - - true - - - 1592100500 - - dev - - v3 - - 160 - - false - - true - - - 1592101700 - - dev - - v4 - - 0 - - false - - false - - - 1592100150 - - staging - - v1 - - 850 - - false - - true - - - 1592100375 - - staging - - v2 - - 625 - - false - - true - - - 1592100660 - - staging - - v3 - - 340 - - false - - true - - - 1592101000 - - prod - - v3 - - 0 - - true - - false - created_at: 1503227026 - updated_at: 1503227526 - error: "" - favorite: true - - id: 10 - name: My KPI 10 - canonical: my-kpi-10 - type: codecoverage - widget: doughnut - description: This KPI shows the code coverage of your code on an - environment - project_canonical: project2 - environment_canonical: env2 - pipeline_name: "" - job_name: "" - data_set: - - - date - - coverage - - - 1592100100 - - 13.4 - - - 1592100150 - - 28.0 - - - 1592100280 - - 85.2 - - - 1592100375 - - 83.9 - created_at: 1503225026 - updated_at: 1503225526 error: "" - favorite: false - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - post: - tags: - - Organization kpis - description: Save information about the KPI - operationId: createKpi - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: project - in: query - description: A canonical of a project used for filtering. - schema: - $ref: '#/components/schemas/Canonical' - - name: environment - in: query - description: The environment canonical to use a query filter - schema: - $ref: '#/components/schemas/EnvironmentCanonical' - - name: begin - in: query - description: "The unix timestamp in seconds, which indicate the start of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: end - in: query - description: "The unix timestamp in seconds, which indicate the end of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: fetch_data - in: query - description: | - Flag to retrieve KPIs' data upon retrieving KPIs themselves - schema: - type: boolean - - name: page_index - in: query - description: The page number to request. The first page is 1. - schema: - type: integer - format: uint32 - default: 1 - - name: page_size - in: query - description: The number of items at most which the response can have. - schema: - type: integer - format: uint32 - default: 1000 - - name: favorite - in: query - description: | - Flag to retrieve favorite data from the members favorite list. - schema: - type: boolean - requestBody: - description: The information of the KPI - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/NewKPI' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NewKPI' - required: true - responses: - "200": - description: KPI has been configured - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/KPI' - example: - data: - id: 1 - name: My KPI 1 - canonical: my-kpi-1 - type: buildavgtime - widget: doughnut - description: This KPI shows the code coverage of your code on an - environment - project_canonical: project1 - environment_canonical: env1 - pipeline_name: pipeline1 - job_name: job1 - created_at: 1503224026 - updated_at: 1503224526 - error: Something went wrong while importing "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -15436,1164 +15315,88 @@ paths: format: uint64 content: application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - x-codegen-request-body-name: body - /organizations/{organization_canonical}/kpis/{kpi_canonical}/favorites: - post: - tags: - - Organization kpis - description: Add a kpi in the user favorites list. - operationId: createKPIFavorite - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: kpi_canonical - in: path - description: A canonical of a kpi. - required: true - schema: - $ref: '#/components/schemas/Canonical' - responses: - "204": - description: The kpi has been added to user favorites list. - content: {} - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - delete: - tags: - - Organization kpis - description: Remove a kpi from the user favorites list. - operationId: deleteKPIFavorite - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: kpi_canonical - in: path - description: A canonical of a kpi. - required: true - schema: - $ref: '#/components/schemas/Canonical' - responses: - "204": - description: The kpi has been removed from user favorites list. - content: {} - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - /organizations/{organization_canonical}/kpis/{kpi_canonical}: - get: - tags: - - Organization kpis - description: Get the KPI - operationId: getKpi - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: kpi_canonical - in: path - description: A canonical of a kpi. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: begin - in: query - description: "The unix timestamp in seconds, which indicate the start of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: end - in: query - description: "The unix timestamp in seconds, which indicate the end of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: fetch_data - in: query - description: | - Flag to retrieve KPIs' data upon retrieving KPIs themselves - schema: - type: boolean - responses: - "200": - description: The KPI - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/KPI' - example: - data: - id: 1 - name: My KPI 1 - canonical: my-kpi-1 - type: buildavgtime - widget: doughnut - description: This KPI shows the code coverage of your code on an - environment - project_canonical: project1 - environment_canonical: env1 - pipeline_name: pipeline1 - job_name: job1 - data_set: - - - date - - time - - - 1607904000 - - 39 - - - 1607817600 - - 140 - created_at: 1503224026 - updated_at: 1503224526 - error: "" - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - put: - tags: - - Organization kpis - description: Update a KPI - operationId: updateKpi - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: kpi_canonical - in: path - description: A canonical of a kpi. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: begin - in: query - description: "The unix timestamp in seconds, which indicate the start of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: end - in: query - description: "The unix timestamp in seconds, which indicate the end of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: fetch_data - in: query - description: | - Flag to retrieve KPIs' data upon retrieving KPIs themselves - schema: - type: boolean - requestBody: - description: The information of the KPI new data - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/NewKPI' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NewKPI' - required: true - responses: - "200": - description: Success update - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/KPI' - example: - data: - id: 11 - name: My KPI 11 - canonical: my-kpi-11 - type: buildavgtime - widget: doughnut - description: This KPI shows the code coverage of your code on an - environment - project_canonical: project1 - environment_canonical: env1 - pipeline_name: pipeline1 - job_name: job1 - created_at: 1503224026 - updated_at: 1503224526 - error: "" - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - "411": - description: The request has a body but it doesn't have a Content-Length - header. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - x-codegen-request-body-name: body - delete: - tags: - - Organization kpis - description: delete a KPI - operationId: deleteKpi - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: kpi_canonical - in: path - description: A canonical of a kpi. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: begin - in: query - description: "The unix timestamp in seconds, which indicate the start of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: end - in: query - description: "The unix timestamp in seconds, which indicate the end of the\ - \ time range." - schema: - type: integer - format: uint64 - - name: fetch_data - in: query - description: | - Flag to retrieve KPIs' data upon retrieving KPIs themselves - schema: - type: boolean - responses: - "204": - description: Organization's KPI has been deleted - content: {} - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - /organizations/{organization_canonical}/licence: - get: - tags: - - Organization licence - description: Get currently active licence. - operationId: getLicence - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - responses: - "200": - description: Currently active licence entity. - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/Licence' - example: - data: - key: eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55X25hbWUiOiJjeWNsb2lkIiwiZW1haWxfYWRkcmVzcyI6ImN5Y2xvaWRAb2ZmaWNlLmlvIiwibWVtYmVyc19jb3VudCI6NSwiZXhwaXJlc19hdCI6IjIwMjItMTItMTNUMDA6MDA6MDBaIiwidmVyc2lvbiI6IjEiLCJhdWQiOiJjeWNsb2lkIiwianRpIjoiNGE1ZTQzMDYtNmUwMy00MjFmLTllM2ItY2VlZmJhZjMyNDk0IiwiaWF0IjoxNjExMzE2NjUwLCJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJuYmYiOjE2MTEzMTY2NTAsInN1YiI6Imh0dHBzOi8vY3ljbG9pZC5pbyJ9.Z_DvpqprGU0uW26vkpzdTYvyC4imiw0AY1FJMmpeEyVkfYlRI2Q1MWcFZPxMaTafi1TAjwwJOxdY1fxnghMfKng4-4dEtPhcsJQy3nC_ODyACtxDpZMRRaIb8pzBN7AqFvBWWPVKAdqfYXI7IZMX5jjIfaFHtzzs5OnXwQ9USl4 - created_at: 1503225026 - updated_at: 1503225026 - company_name: Cycloid - email_address: email@cycloid.io - expires_at: 1503226026 - members_count: 5 - version: "1" - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - security: [] - post: - tags: - - Organization licence - description: "Activate Cycloid's licence. If another licence already exists,\ - \ it will be overwritten" - operationId: activateLicence - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - requestBody: - description: The licence key - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/NewLicence' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NewLicence' - required: true - responses: - "204": - description: The product has been activated - content: {} - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - "411": - description: The request has a body but it doesn't have a Content-Length - header. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - security: [] - x-codegen-request-body-name: body - /organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/logs/sources: - get: - tags: - - Organization Logs - description: Get the list of sources configured for the specified project's - environment of the organization. - operationId: getProjEnvLogSources - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: project_canonical - in: path - description: A canonical of a project. - required: true - schema: - $ref: '#/components/schemas/ProjectCanonical' - - name: environment_canonical - in: path - description: The environment canonical to use as part of a path - required: true - schema: - $ref: '#/components/schemas/EnvironmentCanonical' - responses: - "200": - description: The list of sources related to the project's environment. - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/LogSource' - description: The list of log sources. - example: - data: - - id: access.log - - id: exception.log - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - ? /organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/logs/sources/{log_source_id} - : get: - tags: - - Organization Logs - description: |- - Get log's entries information of the specified log stream stream which is associated to the project's environment of the specified organization. The log's entries to request can be filtered using the unix timestamp ranges and/or the query as follow - When unix timestamps are defined, they are converted to the specific - query language used by the configured underlying log system (e.g AWS - Cloud Watch, ElasticSearch, etc.) and appended to the query value - respecting the syntax but not checking the content of the query, which - means that if the whole query must be enclosed by curly brackets hence - the query value is enclosed on them, the time range filter will be - added inside not just appended at the end, because otherwise it would - cause wrong syntax; on the other hand, not checking the content means - that if the query contains a timerange filter, the whole query will - contain both and the result will be the one returned by on the - underlying log system, being an error or not. - - When no time range are defined, then the query is used as it has been - send, there is not modification on the query to send to the underlying - log system, hence the result will be the one returned by it. - - If none of the filters (timestamp range and query) are sent, then - a 422 status code will be responded. - - Some constraints are established by the underlying log system, so - depending which one has been configured some parameters may be - required or not. - operationId: getProjEnvLogEntries - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: project_canonical - in: path - description: A canonical of a project. - required: true - schema: - $ref: '#/components/schemas/ProjectCanonical' - - name: environment_canonical - in: path - description: The environment canonical to use as part of a path - required: true - schema: - $ref: '#/components/schemas/EnvironmentCanonical' - - name: log_source_id - in: path - description: "A unique identifier, which group log's entries under under a\ - \ context, established by the source." - required: true - schema: - minLength: 1 - type: string - - name: begin - in: query - description: "The unix timestamp in milliseconds, which indicate the start\ - \ of the time range." - schema: - type: integer - format: uint64 - - name: end - in: query - description: "The unix timestamp in milliseconds, which indicate the end of\ - \ the time range." - schema: - type: integer - format: uint64 - - name: query - in: query - description: A free text which the content depends of the context of the API - endpoint. Can be a free text value or a complete query expressed of supported - query language. - schema: - minLength: 1 - type: string - responses: - "200": - description: The list of log's entries which are comprehended by the begin - and end timestamps and are selected by the optional query. - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/LogSourceEntry' - description: The list of log lines - example: - data: - - timestamp: "0123456789" - host: theowlhost - message: "178.154.171.21 - - [21/Sep/2017:02:51:22 +0200] \"GET\ - \ /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg\ - \ HTTP/1.0\" 302 773 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ - \ +http://yandex.com/bots)\"" - - timestamp: "0123456795" - host: mymon - message: "141.8.132.28 - - [21/Sep/2017:02:51:27 +0200] \"GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/\ - \ HTTP/1.0\" 302 731 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ - \ +http://yandex.com/bots)\"" - - timestamp: "0123456800" - host: theowlhost - message: "46.229.168.65 - - [21/Sep/2017:02:51:28 +0200] \"GET /mosquitera-enrollable-lateral.html\ - \ HTTP/1.0\" 200 25313 \"-\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl;\ - \ +http://www.semrush.com/bot.html)\"" - - timestamp: "0123456805" - host: mymon - message: "141.10.132.56 - - [21/Sep/2017:02:51:56 +0200] \"GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/\ - \ HTTP/1.0\" 302 731 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ - \ +http://yandex.com/bots)\"" - - timestamp: "0123456810" - host: burrowing - message: "46.229.168.65 - - [21/Sep/2017:02:52:03 +0200] \"GET /mosquitera-enrollable-lateral.html\ - \ HTTP/1.0\" 200 25313 \"-\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl;\ - \ +http://www.semrush.com/bot.html)\"" - - timestamp: "0123456823" - host: theowlhost - message: "141.10.132.56 - - [21/Sep/2017:02:52:23 +0200] \"GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/\ - \ HTTP/1.0\" 302 731 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ - \ +http://yandex.com/bots)\"" - - timestamp: "0123456834" - host: elf - message: "123.229.145.65 - - [21/Sep/2017:02:52:49 +0200] \"GET\ - \ /mosquitera-enrollable-lateral.html HTTP/1.0\" 200 25313 \"\ - -\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)\"" - - timestamp: "0123456834" - host: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaelf - message: "123.229.145.65 - - [21/Sep/2017:02:52:49 +0200] \"GET\ - \ /mosquitera-enrollable-lateral.html HTTP/1.0\" 200 25313 \"\ - -\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)\"" - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - /organizations/{organization_canonical}/members: - get: - tags: - - Organization members - description: Get the members of an organization. - operationId: getOrgMembers - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: page_index - in: query - description: The page number to request. The first page is 1. - schema: - type: integer - format: uint32 - default: 1 - - name: page_size - in: query - description: The number of items at most which the response can have. - schema: - type: integer - format: uint32 - default: 1000 - - name: user_given_name - in: query - description: Search by the user's given name - schema: - type: string - - name: user_family_name - in: query - description: Search by the user's family name - schema: - type: string - - name: role_name - in: query - description: Search by the role's name - schema: - type: string - - name: user_canonical - in: query - description: Search by the user canonical - schema: - type: string - - name: user_created_at - in: query - description: Search by user creation date - schema: - type: integer - format: uint64 - - name: member_created_at - in: query - description: Search by member joining date - schema: - type: integer - format: uint64 - - name: order_by - in: query - description: | - Allows to order the list of items. Example usage: field_name:asc - schema: - type: string - responses: - "200": - description: List of the members of the organization. - content: - application/json: - schema: - required: - - data - - pagination - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/MemberOrg' - pagination: - $ref: '#/components/schemas/Pagination' - example: - data: - - username: user-1 - id: 1 - given_name: Mariano - family_name: Jimenez - email: mariano.jimenez@fakeemail.com - picture_url: https://avatars2.githubusercontent.com/u/14579210 - created_at: 1503225026 - last_login_at: 1503225576 - role: - id: 17 - name: existing - description: Organization existing role - canonical: role-can - rules: - - id: 1 - effect: allow - action: organization:delete - resources: - - organization:org-can - - organization:org-can2 - - id: 20 - effect: allow - action: organization:team:create - resources: [] - - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - - username: user2 - id: 1 - given_name: Jordi - family_name: Capdevila - email: jordi.capdevila@fakeemail.com - picture_url: https://avatars2.githubusercontent.com/u/14579210 - created_at: 1503281026 - last_login_at: 1503225576 - role: - id: 17 - name: existing - description: Organization existing role - canonical: role-can - rules: - - id: 1 - effect: allow - action: organization:delete - resources: - - organization:org-can - - organization:org-can2 - - id: 20 - effect: allow - action: organization:team:create - resources: [] - - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - - username: user-3 - id: 1 - given_name: Ivan - family_name: Drago - email: ivan.drago@fakeemail.com - picture_url: https://avatars2.githubusercontent.com/u/14579210 - created_at: 1502225026 - last_login_at: 1503225576 - role: - id: 17 - name: existing - description: Organization existing role - canonical: role-can - rules: - - id: 1 - effect: allow - action: organization:delete - resources: - - organization:org-can - - organization:org-can2 - - id: 20 - effect: allow - action: organization:team:create - resources: [] - - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - pagination: - index: 1 - size: 10 - total: 3 + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + put: + tags: + - Organization kpis + description: Update a KPI + operationId: updateKpi + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: kpi_canonical + in: path + description: A canonical of a kpi. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: begin + in: query + description: "The unix timestamp in seconds, which indicate the start of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: end + in: query + description: "The unix timestamp in seconds, which indicate the end of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: fetch_data + in: query + description: | + Flag to retrieve KPIs' data upon retrieving KPIs themselves + schema: + type: boolean + requestBody: + description: The information of the KPI new data + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/NewKPI' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/NewKPI' + required: true + responses: + "200": + description: Success update + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/KPI' + example: + data: + id: 11 + name: My KPI 11 + canonical: my-kpi-11 + type: buildavgtime + widget: doughnut + description: This KPI shows the code coverage of your code on an + environment + project_canonical: project1 + environment_canonical: env1 + pipeline_name: pipeline1 + job_name: job1 + created_at: 1503224026 + updated_at: 1503224526 + error: "" "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -16628,6 +15431,10 @@ paths: errors: - message: Entity not found code: NotFoundEntity + "411": + description: The request has a body but it doesn't have a Content-Length + header. + content: {} "422": description: All the custom errors that are generated from the Cycloid API headers: @@ -16661,12 +15468,12 @@ paths: errors: - message: Server Internal error code: Unexpected - /organizations/{organization_canonical}/members-invitations: - put: + x-codegen-request-body-name: body + delete: tags: - - Organization members - description: Invite a user to be a member of the organization. - operationId: inviteUserToOrgMember + - Organization kpis + description: delete a KPI + operationId: deleteKpi parameters: - name: organization_canonical in: path @@ -16674,24 +15481,39 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - requestBody: - description: The user's member invitation. - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/NewMemberInvitation' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NewMemberInvitation' + - name: kpi_canonical + in: path + description: A canonical of a kpi. required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: begin + in: query + description: "The unix timestamp in seconds, which indicate the start of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: end + in: query + description: "The unix timestamp in seconds, which indicate the end of the\ + \ time range." + schema: + type: integer + format: uint64 + - name: fetch_data + in: query + description: | + Flag to retrieve KPIs' data upon retrieving KPIs themselves + schema: + type: boolean responses: "204": - description: The user has been invited to be a member of the organization. - The verification is pending. + description: Organization's KPI has been deleted content: {} - "404": - description: The response sent when any of the entities present in the path - is not found. + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -16704,14 +15526,11 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Entity not found - code: NotFoundEntity - "411": - description: The request has a body but it doesn't have a Content-Length - header. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -16724,8 +15543,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: some error - code: SomeCode + - message: Entity not found + code: NotFoundEntity default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -16743,13 +15562,12 @@ paths: errors: - message: Server Internal error code: Unexpected - x-codegen-request-body-name: body - /organizations/{organization_canonical}/members/{username}: + /organizations/{organization_canonical}/licence: get: tags: - - Organization members - description: Get the information of a member of the organization. - operationId: getOrgMember + - Organization licence + description: Get currently active licence. + operationId: getLicence parameters: - name: organization_canonical in: path @@ -16757,15 +15575,9 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: username - in: path - description: A username - required: true - schema: - $ref: '#/components/schemas/Canonical' responses: "200": - description: The information of the member of the organization. + description: Currently active licence entity. content: application/json: schema: @@ -16774,41 +15586,81 @@ paths: type: object properties: data: - $ref: '#/components/schemas/MemberOrg' + $ref: '#/components/schemas/Licence' example: data: - id: 1 - username: user2 - given_name: Jordi - family_name: Capdevila - email: jordi.capdevila@fakeemail.com - picture_url: https://avatars2.githubusercontent.com/u/14579210 - created_at: 1503281026 - last_login_at: 1503281333 - role: - id: 17 - name: existing - description: Organization existing role - canonical: role-can - rules: - - id: 1 - effect: allow - action: organization:delete - resources: - - organization:org-can - - organization:org-can2 - - id: 20 - effect: allow - action: organization:team:create - resources: [] - - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." + key: eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55X25hbWUiOiJjeWNsb2lkIiwiZW1haWxfYWRkcmVzcyI6ImN5Y2xvaWRAb2ZmaWNlLmlvIiwibWVtYmVyc19jb3VudCI6NSwiZXhwaXJlc19hdCI6IjIwMjItMTItMTNUMDA6MDA6MDBaIiwidmVyc2lvbiI6IjEiLCJhdWQiOiJjeWNsb2lkIiwianRpIjoiNGE1ZTQzMDYtNmUwMy00MjFmLTllM2ItY2VlZmJhZjMyNDk0IiwiaWF0IjoxNjExMzE2NjUwLCJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJuYmYiOjE2MTEzMTY2NTAsInN1YiI6Imh0dHBzOi8vY3ljbG9pZC5pbyJ9.Z_DvpqprGU0uW26vkpzdTYvyC4imiw0AY1FJMmpeEyVkfYlRI2Q1MWcFZPxMaTafi1TAjwwJOxdY1fxnghMfKng4-4dEtPhcsJQy3nC_ODyACtxDpZMRRaIb8pzBN7AqFvBWWPVKAdqfYXI7IZMX5jjIfaFHtzzs5OnXwQ9USl4 + created_at: 1503225026 + updated_at: 1503225026 + company_name: Cycloid + email_address: email@cycloid.io + expires_at: 1503226026 + members_count: 5 + version: "1" + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + security: [] + post: + tags: + - Organization licence + description: "Activate Cycloid's licence. If another licence already exists,\ + \ it will be overwritten" + operationId: activateLicence + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + requestBody: + description: The licence key + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/NewLicence' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/NewLicence' + required: true + responses: + "204": + description: The product has been activated + content: {} + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -16821,11 +15673,14 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. + - message: Entity not found + code: NotFoundEntity + "411": + description: The request has a body but it doesn't have a Content-Length + header. + content: {} + "422": + description: All the custom errors that are generated from the Cycloid API headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -16838,8 +15693,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Entity not found - code: NotFoundEntity + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -16857,11 +15712,15 @@ paths: errors: - message: Server Internal error code: Unexpected - put: + security: [] + x-codegen-request-body-name: body + /organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/logs/sources: + get: tags: - - Organization members - description: Update member of the organization. - operationId: updateOrgMember + - Organization Logs + description: Get the list of sources configured for the specified project's + environment of the organization. + operationId: getProjEnvLogSources parameters: - name: organization_canonical in: path @@ -16869,25 +15728,21 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: username + - name: project_canonical in: path - description: A username + description: A canonical of a project. required: true schema: - $ref: '#/components/schemas/Canonical' - requestBody: - description: The member information to be updated. - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/MemberAssignation' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/MemberAssignation' + $ref: '#/components/schemas/ProjectCanonical' + - name: environment_canonical + in: path + description: The environment canonical to use as part of a path required: true + schema: + $ref: '#/components/schemas/EnvironmentCanonical' responses: "200": - description: The information of the member of the organization. + description: The list of sources related to the project's environment. content: application/json: schema: @@ -16896,41 +15751,14 @@ paths: type: object properties: data: - $ref: '#/components/schemas/MemberOrg' + type: array + items: + $ref: '#/components/schemas/LogSource' + description: The list of log sources. example: data: - id: 1 - username: user2 - given_name: Jordi - family_name: Capdevila - email: jordi.capdevila@fakeemail.com - picture_url: https://avatars2.githubusercontent.com/u/14579210 - created_at: 1503281026 - role: - id: 2 - name: project manager - description: A project manager - policies: - - id: 21 - code: team:read - entities: [] - description: Grant the access to read the teams of an organization - - id: 22 - code: team:edit - entities: [] - description: Grant the access to edit teams - - id: 60 - code: project:read - entities: [] - description: Grant the access to projects - - id: 61 - code: project:create - entities: [] - description: Grant the access to create a project in the organization - - id: 62 - code: project:edit - entities: [] - description: Grant the access to edit projects + - id: access.log + - id: exception.log "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -16965,22 +15793,6 @@ paths: errors: - message: Entity not found code: NotFoundEntity - "422": - description: All the custom errors that are generated from the Cycloid API - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: some error - code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -16998,12 +15810,31 @@ paths: errors: - message: Server Internal error code: Unexpected - x-codegen-request-body-name: body - delete: + ? /organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/logs/sources/{log_source_id} + : get: tags: - - Organization members - description: Remove a member of the organization. - operationId: removeOrgMember + - Organization Logs + description: |- + Get log's entries information of the specified log stream stream which is associated to the project's environment of the specified organization. The log's entries to request can be filtered using the unix timestamp ranges and/or the query as follow - When unix timestamps are defined, they are converted to the specific + query language used by the configured underlying log system (e.g AWS + Cloud Watch, ElasticSearch, etc.) and appended to the query value + respecting the syntax but not checking the content of the query, which + means that if the whole query must be enclosed by curly brackets hence + the query value is enclosed on them, the time range filter will be + added inside not just appended at the end, because otherwise it would + cause wrong syntax; on the other hand, not checking the content means + that if the query contains a timerange filter, the whole query will + contain both and the result will be the one returned by on the + underlying log system, being an error or not. + - When no time range are defined, then the query is used as it has been + send, there is not modification on the query to send to the underlying + log system, hence the result will be the one returned by it. + - If none of the filters (timestamp range and query) are sent, then + a 422 status code will be responded. + - Some constraints are established by the underlying log system, so + depending which one has been configured some parameters may be + required or not. + operationId: getProjEnvLogEntries parameters: - name: organization_canonical in: path @@ -17011,16 +15842,107 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: username + - name: project_canonical in: path - description: A username + description: A canonical of a project. required: true schema: - $ref: '#/components/schemas/Canonical' + $ref: '#/components/schemas/ProjectCanonical' + - name: environment_canonical + in: path + description: The environment canonical to use as part of a path + required: true + schema: + $ref: '#/components/schemas/EnvironmentCanonical' + - name: log_source_id + in: path + description: "A unique identifier, which group log's entries under under a\ + \ context, established by the source." + required: true + schema: + minLength: 1 + type: string + - name: begin + in: query + description: "The unix timestamp in milliseconds, which indicate the start\ + \ of the time range." + schema: + type: integer + format: uint64 + - name: end + in: query + description: "The unix timestamp in milliseconds, which indicate the end of\ + \ the time range." + schema: + type: integer + format: uint64 + - name: query + in: query + description: A free text which the content depends of the context of the API + endpoint. Can be a free text value or a complete query expressed of supported + query language. + schema: + minLength: 1 + type: string responses: - "204": - description: Member has been removed. - content: {} + "200": + description: The list of log's entries which are comprehended by the begin + and end timestamps and are selected by the optional query. + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/LogSourceEntry' + description: The list of log lines + example: + data: + - timestamp: "0123456789" + host: theowlhost + message: "178.154.171.21 - - [21/Sep/2017:02:51:22 +0200] \"GET\ + \ /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg\ + \ HTTP/1.0\" 302 773 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ + \ +http://yandex.com/bots)\"" + - timestamp: "0123456795" + host: mymon + message: "141.8.132.28 - - [21/Sep/2017:02:51:27 +0200] \"GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/\ + \ HTTP/1.0\" 302 731 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ + \ +http://yandex.com/bots)\"" + - timestamp: "0123456800" + host: theowlhost + message: "46.229.168.65 - - [21/Sep/2017:02:51:28 +0200] \"GET /mosquitera-enrollable-lateral.html\ + \ HTTP/1.0\" 200 25313 \"-\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl;\ + \ +http://www.semrush.com/bot.html)\"" + - timestamp: "0123456805" + host: mymon + message: "141.10.132.56 - - [21/Sep/2017:02:51:56 +0200] \"GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/\ + \ HTTP/1.0\" 302 731 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ + \ +http://yandex.com/bots)\"" + - timestamp: "0123456810" + host: burrowing + message: "46.229.168.65 - - [21/Sep/2017:02:52:03 +0200] \"GET /mosquitera-enrollable-lateral.html\ + \ HTTP/1.0\" 200 25313 \"-\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl;\ + \ +http://www.semrush.com/bot.html)\"" + - timestamp: "0123456823" + host: theowlhost + message: "141.10.132.56 - - [21/Sep/2017:02:52:23 +0200] \"GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/\ + \ HTTP/1.0\" 302 731 \"-\" \"Mozilla/5.0 (compatible; YandexBot/3.0;\ + \ +http://yandex.com/bots)\"" + - timestamp: "0123456834" + host: elf + message: "123.229.145.65 - - [21/Sep/2017:02:52:49 +0200] \"GET\ + \ /mosquitera-enrollable-lateral.html HTTP/1.0\" 200 25313 \"\ + -\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)\"" + - timestamp: "0123456834" + host: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaelf + message: "123.229.145.65 - - [21/Sep/2017:02:52:49 +0200] \"GET\ + \ /mosquitera-enrollable-lateral.html HTTP/1.0\" 200 25313 \"\ + -\" \"Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)\"" "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -17055,6 +15977,22 @@ paths: errors: - message: Entity not found code: NotFoundEntity + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -26912,7 +25850,7 @@ paths: - message: Server Internal error code: Unexpected x-codegen-request-body-name: body - /organizations/{organization_canonical}/teams/{team_canonical}/members/{username}: + /organizations/{organization_canonical}/teams/{team_canonical}/members/{member_id}: get: tags: - Organization team members @@ -26925,18 +25863,16 @@ paths: required: true schema: $ref: '#/components/schemas/Canonical' - - name: team_canonical - in: path - description: A canonical of a team. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: username + - name: team_canonical in: path - description: A username + description: A canonical of a team. required: true schema: - $ref: '#/components/schemas/Canonical' + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + - $ref: '#/components/parameters/member_id' responses: "200": description: The information of the member of the team. @@ -29447,12 +28383,445 @@ paths: errors: - message: Server Internal error code: Unexpected - /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}: + /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}: + get: + tags: + - Service catalogs + description: Get the information of the service catalog + operationId: getServiceCatalog + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: service_catalog_ref + in: path + description: A Service Catalog name + required: true + schema: + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + responses: + "200": + description: The information of the service catalog. + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/ServiceCatalog' + example: + data: + id: 1 + name: stack-magento + author: Cycloid + canonical: stack-magento + image: http://via.placeholder.com/150x150 + description: Super magento stack + trusted: true + keywords: + - stack + - php + status: private + ref: cycloidio:stack-magento + directory: / + technologies: + - technology: nginx + version: "1.15" + - technology: debian + version: "9.1" + - technology: magento + version: "2.2" + - technology: Php + version: "7.2" + - technology: Redis + version: "2.4" + - technology: Elasticsearch + version: "6.2" + service_catalog_source_canonical: scscan + created_at: 1503225026 + updated_at: 1503335026 + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Entity not found + code: NotFoundEntity + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + put: + tags: + - Service catalogs + description: Update the information of the service catalog + operationId: updateServiceCatalog + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: service_catalog_ref + in: path + description: A Service Catalog name + required: true + schema: + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + requestBody: + description: The information of the ServiceCatalog Terraform. + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/NewServiceCatalog' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/NewServiceCatalog' + required: true + responses: + "200": + description: Updated the Service Catalog + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/ServiceCatalog' + example: + data: + id: 1 + name: stack-magento + author: Cycloid + canonical: stack-magento + image: http://via.placeholder.com/150x150 + description: Super magento stack + type: stack + trusted: true + keywords: + - stack + - php + ref: cycloidio:stack-magento + directory: / + status: private + technologies: + - technology: nginx + version: "1.15" + - technology: debian + version: "9.1" + - technology: magento + version: "2.2" + - technology: Php + version: "7.2" + - technology: Redis + version: "2.4" + - technology: Elasticsearch + version: "6.2" + created_at: 1503225026 + updated_at: 1503335026 + service_catalog_source_canonical: scscan + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode + "404": + description: The response sent when any of the entities present in the path + is not found. + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Entity not found + code: NotFoundEntity + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + x-codegen-request-body-name: body + delete: + tags: + - Service catalogs + description: Delete the service catalog. + operationId: deleteServiceCatalog + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: service_catalog_ref + in: path + description: A Service Catalog name + required: true + schema: + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + responses: + "204": + description: Service Catalog has been deleted. + content: {} + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Entity not found + code: NotFoundEntity + "409": + description: Service Catalog deletion has internal conflict + content: {} + /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/template: + post: + tags: + - Service catalogs + description: | + Create a new Service Catalog using the ref and use case passed as template + operationId: createServiceCatalogFromTemplate + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + $ref: '#/components/schemas/Canonical' + - name: service_catalog_ref + in: path + description: A Service Catalog name + required: true + schema: + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + requestBody: + description: The information of the ServiceCatalog. + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/NewServiceCatalogFromTemplate' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/NewServiceCatalogFromTemplate' + required: true + responses: + "200": + description: The information of the service catalog. + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/ServiceCatalog' + example: + data: + name: bootstrap-stack + author: Cycloid + canonical: bootstrap-stack + service_catalog_source_canonical: scscan + use_case: aws-ec2 + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode + "404": + description: The response sent when any of the entities present in the path + is not found. + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Entity not found + code: NotFoundEntity + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + x-codegen-request-body-name: body + /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/{use_case_canonical}/terraform: get: tags: - Service catalogs - description: Get the information of the service catalog - operationId: getServiceCatalog + description: Get the information of the service catalog Terraform config + operationId: getServiceCatalogTerraform parameters: - name: organization_canonical in: path @@ -29467,9 +28836,15 @@ paths: schema: pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string + - name: use_case_canonical + in: path + description: A use case canonical + required: true + schema: + $ref: '#/components/schemas/Canonical' responses: "200": - description: The information of the service catalog. + description: The information of Terraform content: application/json: schema: @@ -29478,38 +28853,32 @@ paths: type: object properties: data: - $ref: '#/components/schemas/ServiceCatalog' + $ref: '#/components/schemas/TerraformJSONConfig' example: data: - id: 1 - name: stack-magento - author: Cycloid - canonical: stack-magento - image: http://via.placeholder.com/150x150 - description: Super magento stack - trusted: true - keywords: - - stack - - php - status: private - ref: cycloidio:stack-magento - directory: / - technologies: - - technology: nginx - version: "1.15" - - technology: debian - version: "9.1" - - technology: magento - version: "2.2" - - technology: Php - version: "7.2" - - technology: Redis - version: "2.4" - - technology: Elasticsearch - version: "6.2" - service_catalog_source_canonical: scscan - created_at: 1503225026 - updated_at: 1503335026 + config: + data: + aws_ami: + debian_jessie_latest: + most_recent: true + resource: + aws_elb: + front: + name: "${var.project}-front-${var.env}" + tags: + name: some name + variable: + front_disk_size: + default: 60 + provider: + aws: + access_key: "${var.access_key}" + locals: + codecommit_repository_name: something + output: + sensitive: + sensitive: true + value: VALUE "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -29564,8 +28933,9 @@ paths: put: tags: - Service catalogs - description: Update the information of the service catalog - operationId: updateServiceCatalog + description: Update/Create the information of the service catalog Terraform + config + operationId: updateServiceCatalogTerraform parameters: - name: organization_canonical in: path @@ -29580,60 +28950,26 @@ paths: schema: pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string + - name: use_case_canonical + in: path + description: A use case canonical + required: true + schema: + $ref: '#/components/schemas/Canonical' requestBody: description: The information of the ServiceCatalog Terraform. content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/NewServiceCatalog' + $ref: '#/components/schemas/TerraformJSONConfig' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/NewServiceCatalog' + $ref: '#/components/schemas/TerraformJSONConfig' required: true responses: - "200": - description: Updated the Service Catalog - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/ServiceCatalog' - example: - data: - id: 1 - name: stack-magento - author: Cycloid - canonical: stack-magento - image: http://via.placeholder.com/150x150 - description: Super magento stack - type: stack - trusted: true - keywords: - - stack - - php - ref: cycloidio:stack-magento - directory: / - status: private - technologies: - - technology: nginx - version: "1.15" - - technology: debian - version: "9.1" - - technology: magento - version: "2.2" - - technology: Php - version: "7.2" - - technology: Redis - version: "2.4" - - technology: Elasticsearch - version: "6.2" - created_at: 1503225026 - updated_at: 1503335026 - service_catalog_source_canonical: scscan + "204": + description: Configuration has been updated + content: {} "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -29702,11 +29038,12 @@ paths: - message: Server Internal error code: Unexpected x-codegen-request-body-name: body - delete: + /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/terraform/diagram: + get: tags: - Service catalogs - description: Delete the service catalog. - operationId: deleteServiceCatalog + description: Get the information of the service catalog Terraform diagram + operationId: getServiceCatalogTerraformDiagram parameters: - name: organization_canonical in: path @@ -29722,9 +29059,31 @@ paths: pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string responses: - "204": - description: Service Catalog has been deleted. - content: {} + "200": + description: The information of Terraform Diagram + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/TerraformJSONDiagram' + created_at: + minimum: 0 + type: integer + format: uint64 + updated_at: + minimum: 0 + type: integer + format: uint64 + example: + data: + random: + data: true + created_at: 1503225026 + updated_at: 1503335026 "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -29759,16 +29118,29 @@ paths: errors: - message: Entity not found code: NotFoundEntity - "409": - description: Service Catalog deletion has internal conflict - content: {} - /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/template: - post: + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + put: tags: - Service catalogs - description: | - Create a new Service Catalog using the ref and use case passed as template - operationId: createServiceCatalogFromTemplate + description: Update/Create the information of the service catalog Terraform + diagram + operationId: updateServiceCatalogTerraformDiagram parameters: - name: organization_canonical in: path @@ -29784,34 +29156,19 @@ paths: pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string requestBody: - description: The information of the ServiceCatalog. + description: The information of the ServiceCatalog Terraform Diagram content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/NewServiceCatalogFromTemplate' + $ref: '#/components/schemas/TerraformJSONDiagram' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/NewServiceCatalogFromTemplate' + $ref: '#/components/schemas/TerraformJSONDiagram' required: true responses: - "200": - description: The information of the service catalog. - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/ServiceCatalog' - example: - data: - name: bootstrap-stack - author: Cycloid - canonical: bootstrap-stack - service_catalog_source_canonical: scscan - use_case: aws-ec2 + "204": + description: Configuration has been updated + content: {} "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -29880,12 +29237,12 @@ paths: - message: Server Internal error code: Unexpected x-codegen-request-body-name: body - /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/{use_case_canonical}/terraform: + /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/terraform/diagram/image: get: tags: - Service catalogs - description: Get the information of the service catalog Terraform config - operationId: getServiceCatalogTerraform + description: Get the SC TF Image + operationId: getServiceCatalogTerraformImage parameters: - name: organization_canonical in: path @@ -29900,15 +29257,9 @@ paths: schema: pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string - - name: use_case_canonical - in: path - description: A use case canonical - required: true - schema: - $ref: '#/components/schemas/Canonical' responses: "200": - description: The information of Terraform + description: The SC TF Image content: application/json: schema: @@ -29917,32 +29268,7 @@ paths: type: object properties: data: - $ref: '#/components/schemas/TerraformJSONConfig' - example: - data: - config: - data: - aws_ami: - debian_jessie_latest: - most_recent: true - resource: - aws_elb: - front: - name: "${var.project}-front-${var.env}" - tags: - name: some name - variable: - front_disk_size: - default: 60 - provider: - aws: - access_key: "${var.access_key}" - locals: - codecommit_repository_name: something - output: - sensitive: - sensitive: true - value: VALUE + $ref: '#/components/schemas/TerraformImage' "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -29997,9 +29323,8 @@ paths: put: tags: - Service catalogs - description: Update/Create the information of the service catalog Terraform - config - operationId: updateServiceCatalogTerraform + description: Update/Create the Image for the SC TF Image + operationId: updateServiceCatalogTerraformImage parameters: - name: organization_canonical in: path @@ -30014,21 +29339,15 @@ paths: schema: pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string - - name: use_case_canonical - in: path - description: A use case canonical - required: true - schema: - $ref: '#/components/schemas/Canonical' requestBody: - description: The information of the ServiceCatalog Terraform. + description: The information of the ServiceCatalog Terraform Diagram content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/TerraformJSONConfig' + $ref: '#/components/schemas/TerraformImage' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TerraformJSONConfig' + $ref: '#/components/schemas/TerraformImage' required: true responses: "204": @@ -30067,23 +29386,6 @@ paths: errors: - message: some error code: SomeCode - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Entity not found - code: NotFoundEntity default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30102,12 +29404,12 @@ paths: - message: Server Internal error code: Unexpected x-codegen-request-body-name: body - /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/terraform/diagram: + /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/dependencies/validate: get: tags: - Service catalogs - description: Get the information of the service catalog Terraform diagram - operationId: getServiceCatalogTerraformDiagram + description: Validates the dependencies of a Service Catalog + operationId: validateServiceCatalogDependencies parameters: - name: organization_canonical in: path @@ -30124,7 +29426,7 @@ paths: type: string responses: "200": - description: The information of Terraform Diagram + description: The result of the service catalog's dependencies validation content: application/json: schema: @@ -30133,21 +29435,13 @@ paths: type: object properties: data: - $ref: '#/components/schemas/TerraformJSONDiagram' - created_at: - minimum: 0 - type: integer - format: uint64 - updated_at: - minimum: 0 - type: integer - format: uint64 + $ref: '#/components/schemas/ServiceCatalogDependenciesValidationResult' example: data: - random: - data: true - created_at: 1503225026 - updated_at: 1503335026 + errors: + - dependency 'abc' is required to deploy the stack + warnings: + - dependency 'dep' is recommended to deploy the stack "403": description: "The authenticated user cannot perform the operation because,\ \ it doesn't have permissions for such operation." @@ -30165,9 +29459,8 @@ paths: errors: - message: Not enough permissions to perform the operation code: Unauthorized - "404": - description: The response sent when any of the entities present in the path - is not found. + "422": + description: All the custom errors that are generated from the Cycloid API headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30180,8 +29473,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Entity not found - code: NotFoundEntity + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30199,43 +29492,31 @@ paths: errors: - message: Server Internal error code: Unexpected - put: + /user/email/verification: + post: tags: - - Service catalogs - description: Update/Create the information of the service catalog Terraform - diagram - operationId: updateServiceCatalogTerraformDiagram - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: service_catalog_ref - in: path - description: A Service Catalog name - required: true - schema: - pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" - type: string + - User + description: Re-send the verification user's email to the indicated address. + operationId: emailVerificationResend requestBody: - description: The information of the ServiceCatalog Terraform Diagram + description: The email address to re-send the verification email. This endpoint + doesn't return any error status code if the email doesn't exist nor it's + already verified for avoiding that an attacker could find registered users + email address. content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/TerraformJSONDiagram' + $ref: '#/components/schemas/UserEmail' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TerraformJSONDiagram' + $ref: '#/components/schemas/UserEmail' required: true responses: "204": - description: Configuration has been updated + description: The email verification has been re-sent. content: {} - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." + "422": + description: All the custom errors that are generated from the Cycloid API headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30248,10 +29529,11 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "422": - description: All the custom errors that are generated from the Cycloid API + - message: some error + code: SomeCode + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30264,8 +29546,28 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: some error - code: SomeCode + - message: Server Internal error + code: Unexpected + security: [] + x-codegen-request-body-name: body + /user/email/verification/{verification_token}: + put: + tags: + - User + description: Verify that the email address is own by the user. + operationId: emailVerification + parameters: + - name: verification_token + in: path + description: "A token for verifying emails, invitations, etc." + required: true + schema: + minLength: 5 + type: string + responses: + "204": + description: Email address has been verified. + content: {} "404": description: The response sent when any of the entities present in the path is not found. @@ -30283,6 +29585,22 @@ paths: errors: - message: Entity not found code: NotFoundEntity + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30300,30 +29618,24 @@ paths: errors: - message: Server Internal error code: Unexpected - x-codegen-request-body-name: body - /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/terraform/diagram/image: - get: + security: [] + /user/email/authentication/{authentication_token}: + put: tags: - - Service catalogs - description: Get the SC TF Image - operationId: getServiceCatalogTerraformImage + - User + description: Verify that the email address is own by the user. + operationId: emailAuthenticationVerification parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: service_catalog_ref + - name: authentication_token in: path - description: A Service Catalog name + description: A token for authenticating login vie email required: true schema: - pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + minLength: 5 type: string responses: "200": - description: The SC TF Image + description: The token which represents the session of the user. content: application/json: schema: @@ -30332,10 +29644,22 @@ paths: type: object properties: data: - $ref: '#/components/schemas/TerraformImage' - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." + $ref: '#/components/schemas/UserSession' + example: + data: + owns: + - organization:seraf:team:teamcan + permissions: + organization:team:create: + id: 21 + effect: allow + action: organization:team:read + resources: + - organization:org-can:team:team-can + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9fX0.v6BuWwO6vN6PNW9d-Eqdoy7GHfUXKQ7byRbqwKRwHlA + "401": + description: The user cannot be authenticated with the credentials which + she/he has used. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30348,8 +29672,62 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Not enough permissions to perform the operation - code: Unauthorized + - code: Unauthenticated + message: invalid credentials + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + security: [] + /user/guide: + put: + tags: + - User + description: Update user's guide progress. + operationId: updateUserGuide + requestBody: + description: The guide's progress JSON schema + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/UserGuide' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/UserGuide' + required: false + responses: + "204": + description: The guide progress has been updated. + content: {} "404": description: The response sent when any of the entities present in the path is not found. @@ -30367,6 +29745,22 @@ paths: errors: - message: Entity not found code: NotFoundEntity + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30384,42 +29778,51 @@ paths: errors: - message: Server Internal error code: Unexpected - put: + security: [] + x-codegen-request-body-name: body + /user/login: + post: tags: - - Service catalogs - description: Update/Create the Image for the SC TF Image - operationId: updateServiceCatalogTerraformImage - parameters: - - name: organization_canonical - in: path - description: A canonical of an organization. - required: true - schema: - $ref: '#/components/schemas/Canonical' - - name: service_catalog_ref - in: path - description: A Service Catalog name - required: true - schema: - pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" - type: string + - User + description: Authenticate a user and return a new JWT token. + operationId: login requestBody: - description: The information of the ServiceCatalog Terraform Diagram + description: The user content content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/TerraformImage' + $ref: '#/components/schemas/UserLogin' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TerraformImage' + $ref: '#/components/schemas/UserLogin' required: true responses: - "204": - description: Configuration has been updated - content: {} - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." + "200": + description: The token which represents the session of the user. + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/UserSession' + example: + data: + owns: + - organization:seraf:team:teamcan + permissions: + organization:team:create: + id: 21 + effect: allow + action: organization:team:read + resources: + - organization:org-can:team:team-can + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9fX0.v6BuWwO6vN6PNW9d-Eqdoy7GHfUXKQ7byRbqwKRwHlA + "401": + description: The user cannot be authenticated with the credentials which + she/he has used. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30432,8 +29835,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Not enough permissions to perform the operation - code: Unauthorized + - code: Unauthenticated + message: invalid credentials "422": description: All the custom errors that are generated from the Cycloid API headers: @@ -30467,30 +29870,37 @@ paths: errors: - message: Server Internal error code: Unexpected + security: [] x-codegen-request-body-name: body - /organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/dependencies/validate: + /user/{social_type}/oauth: get: tags: - - Service catalogs - description: Validates the dependencies of a Service Catalog - operationId: validateServiceCatalogDependencies + - User + description: "Used to know if a user from the platform exists on that 'social_type'.\ + \ If it exists we'll return the JWT 'token', if it does not we'll return the\ + \ data of that user on the 'user' so it can be confirmed and created" + operationId: getOAuthUser parameters: - - name: organization_canonical + - name: social_type in: path - description: A canonical of an organization. + description: The OAuth Social type required: true schema: - $ref: '#/components/schemas/Canonical' - - name: service_catalog_ref - in: path - description: A Service Catalog name + type: string + enum: + - azuread + - saml2 + - google + - github + - name: oauth_code + in: query + description: The OAuth code returned form the Social Provider required: true schema: - pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" type: string responses: "200": - description: The result of the service catalog's dependencies validation + description: Used to know if a user from the platform exists on that 'social_type'. content: application/json: schema: @@ -30499,32 +29909,18 @@ paths: type: object properties: data: - $ref: '#/components/schemas/ServiceCatalogDependenciesValidationResult' + $ref: '#/components/schemas/UserOAuth' example: data: - errors: - - dependency 'abc' is required to deploy the stack - warnings: - - dependency 'dep' is recommended to deploy the stack - "403": - description: "The authenticated user cannot perform the operation because,\ - \ it doesn't have permissions for such operation." - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - "422": - description: All the custom errors that are generated from the Cycloid API + user: + email: some@email.com + given_name: some name + username: some-name + picture_url: https://via.placeholder.com/150?text=cycloid.io + social_id: some-random-id + "401": + description: The user cannot be authenticated with the credentials which + she/he has used. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30537,8 +29933,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: some error - code: SomeCode + - code: Unauthenticated + message: invalid credentials default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30556,31 +29952,52 @@ paths: errors: - message: Server Internal error code: Unexpected - /user/email/verification: + security: [] post: tags: - User - description: Re-send the verification user's email to the indicated address. - operationId: emailVerificationResend + description: Create a user from the OAuth 'social_type' + operationId: createOAuthUser + parameters: + - name: social_type + in: path + description: The OAuth Social type + required: true + schema: + type: string + enum: + - azuread + - saml2 + - google + - github requestBody: - description: The email address to re-send the verification email. This endpoint - doesn't return any error status code if the email doesn't exist nor it's - already verified for avoiding that an attacker could find registered users - email address. + description: The user content content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/UserEmail' + $ref: '#/components/schemas/NewOAuthUser' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserEmail' + $ref: '#/components/schemas/NewOAuthUser' required: true responses: - "204": - description: The email verification has been re-sent. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API + "200": + description: Create a user from the OAuth 'social_type' + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/UserSession' + example: + data: + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9LCJvcmdhbml6YXRpb24iOnsiaWQiOjIsImNhbm9uaWNhbCI6Im9yZzIiLCJuYW1lIjoiT3JnIDIifSwicGVybWlzc2lvbnMiOnsib3JnYW5pemF0aW9uOmRlbGV0ZSI6WyIxIl0sIm9yZ2FuaXphdGlvbjp1cGRhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpyZWFkIjpbXSwib3JnYW5pemF0aW9uOnRlYW06ZGVsZXRlIjpbIjIiXSwib3JnYW5pemF0aW9uOm1lbWJlcjpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOnJlYWQiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOmRlbGV0ZSI6W10sIm9yZ2FuaXphdGlvbjpwcm9qZWN0OnJlYWQiOltdfX19.CHA3146UEHwVW6nYkDgYeSukGeZIH55mi4O0LsemenA + "401": + description: The user cannot be authenticated with the credentials which + she/he has used. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30593,8 +30010,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: some error - code: SomeCode + - code: Unauthenticated + message: invalid credentials default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30614,43 +30031,53 @@ paths: code: Unexpected security: [] x-codegen-request-body-name: body - /user/email/verification/{verification_token}: - put: + /user/refresh_token: + get: tags: - User - description: Verify that the email address is own by the user. - operationId: emailVerification + description: "Refresh the user JWT and returns a new one if the previous is\ + \ valid. The 'organization_canonical_query' has to be of an organization in\ + \ which the user belongs to, and the 'child_canonical_query' of a child of\ + \ the 'organization_canonical_query' in any level (could be of a grand child)." + operationId: refreshToken parameters: - - name: verification_token - in: path - description: "A token for verifying emails, invitations, etc." - required: true + - name: organization_canonical + in: query + description: A canonical of a organization used for filtering. schema: - minLength: 5 - type: string + $ref: '#/components/schemas/Canonical' + - name: child_canonical + in: query + description: A canonical of a child organization used for filtering. + schema: + $ref: '#/components/schemas/Canonical' responses: - "204": - description: Email address has been verified. - content: {} - "404": - description: The response sent when any of the entities present in the path - is not found. - headers: - Content-Length: - description: The length of the response body in octets (8-bit bytes). - schema: - type: integer - format: uint64 + "200": + description: The token which represents the session of the user. content: application/json: schema: - $ref: '#/components/schemas/ErrorPayload' + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/UserSession' example: - errors: - - message: Entity not found - code: NotFoundEntity - "422": - description: All the custom errors that are generated from the Cycloid API + data: + owns: + - organization:seraf:team:teamcan + permissions: + organization:team:create: + id: 21 + effect: allow + action: organization:team:read + resources: + - organization:org-can:team:team-can + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9LCJvcmdhbml6YXRpb24iOnsiaWQiOjIsImNhbm9uaWNhbCI6Im9yZzIiLCJuYW1lIjoiT3JnIDIifSwicGVybWlzc2lvbnMiOnsib3JnYW5pemF0aW9uOmRlbGV0ZSI6WyIxIl0sIm9yZ2FuaXphdGlvbjp1cGRhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpyZWFkIjpbXSwib3JnYW5pemF0aW9uOnRlYW06ZGVsZXRlIjpbIjIiXSwib3JnYW5pemF0aW9uOm1lbWJlcjpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOnJlYWQiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOmRlbGV0ZSI6W10sIm9yZ2FuaXphdGlvbjpwcm9qZWN0OnJlYWQiOltdfX19.CHA3146UEHwVW6nYkDgYeSukGeZIH55mi4O0LsemenA + "401": + description: The user cannot be authenticated with the credentials which + she/he has used. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30663,8 +30090,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: some error - code: SomeCode + - code: Unauthenticated + message: invalid credentials default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30682,48 +30109,32 @@ paths: errors: - message: Server Internal error code: Unexpected - security: [] - /user/email/authentication/{authentication_token}: + /user/reset_password: put: tags: - User - description: Verify that the email address is own by the user. - operationId: emailAuthenticationVerification - parameters: - - name: authentication_token - in: path - description: A token for authenticating login vie email - required: true - schema: - minLength: 5 - type: string - responses: - "200": - description: The token which represents the session of the user. - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/UserSession' - example: - data: - owns: - - organization:seraf:team:teamcan - permissions: - organization:team:create: - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9fX0.v6BuWwO6vN6PNW9d-Eqdoy7GHfUXKQ7byRbqwKRwHlA - "401": - description: The user cannot be authenticated with the credentials which - she/he has used. + description: "Reset the user password when it has been forgotten. Due to security\ + \ reasons, the endpoint doesn't return a Unprocessable Entity (422) when the\ + \ token is invalid. 404 Status code is returned if the user has been deleted\ + \ of the system between the user password request and this request." + operationId: passwordResetUpdate + requestBody: + description: The reset password payload + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/UserPasswordResetUpdate' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/UserPasswordResetUpdate' + required: true + responses: + "204": + description: The password has been changed. + content: {} + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30736,8 +30147,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - code: Unauthenticated - message: invalid credentials + - message: Entity not found + code: NotFoundEntity "422": description: All the custom errors that are generated from the Cycloid API headers: @@ -30772,29 +30183,30 @@ paths: - message: Server Internal error code: Unexpected security: [] - /user/guide: - put: + x-codegen-request-body-name: body + post: tags: - User - description: Update user's guide progress. - operationId: updateUserGuide + description: "Request to reset the password. Due to security reasons, this endpoint\ + \ doesn't return Not Found (404) when the email doesn't exist or belongs to\ + \ a user primary email." + operationId: passwordResetReq requestBody: - description: The guide's progress JSON schema + description: The reset password payload content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/UserGuide' + $ref: '#/components/schemas/UserPasswordResetReq' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserGuide' - required: false + $ref: '#/components/schemas/UserPasswordResetReq' + required: true responses: "204": - description: The guide progress has been updated. + description: The password has been changed. content: {} - "404": - description: The response sent when any of the entities present in the path - is not found. + "422": + description: All the custom errors that are generated from the Cycloid API headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30807,10 +30219,11 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: Entity not found - code: NotFoundEntity - "422": - description: All the custom errors that are generated from the Cycloid API + - message: some error + code: SomeCode + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30823,8 +30236,59 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - message: some error - code: SomeCode + - message: Server Internal error + code: Unexpected + security: [] + x-codegen-request-body-name: body + /user: + get: + tags: + - User + description: Get the information of the account of the authenticated user. + operationId: getUserAccount + responses: + "200": + description: The user account information. + content: + application/json: + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/UserAccount' + example: + data: + created_at: 1503225026 + updated_at: 1503335026 + last_login: 1503413020 + emails: + - email: mariano@jimenez.com + verified: true + purpose: primary + username: user-1 + given_name: Mariano + family_name: Jimenez + picture_url: https://avatars2.githubusercontent.com/u/14579210 + locale: en + country: + code: GB + name: United Kingdom + guide: + tutorial: + welcome: false + letsgo: false + credentials: false + createProject: false + selectStack: false + configEnv: false + customEnvConfig: false + reviewDeploy: false + deployed: false + tasksDetails: false + finish: false + presentation: false default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -30842,27 +30306,24 @@ paths: errors: - message: Server Internal error code: Unexpected - security: [] - x-codegen-request-body-name: body - /user/login: - post: + put: tags: - User - description: Authenticate a user and return a new JWT token. - operationId: login + description: Update the information of the account of the authenticated user. + operationId: updateUserAccount requestBody: description: The user content content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/UserLogin' + $ref: '#/components/schemas/UpdateUserAccount' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserLogin' + $ref: '#/components/schemas/UpdateUserAccount' required: true responses: "200": - description: The token which represents the session of the user. + description: The updated user profile information. content: application/json: schema: @@ -30871,22 +30332,31 @@ paths: type: object properties: data: - $ref: '#/components/schemas/UserSession' + $ref: '#/components/schemas/UserAccount' example: data: - owns: - - organization:seraf:team:teamcan - permissions: - organization:team:create: - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9fX0.v6BuWwO6vN6PNW9d-Eqdoy7GHfUXKQ7byRbqwKRwHlA - "401": - description: The user cannot be authenticated with the credentials which - she/he has used. + created_at: 1503225026 + updated_at: 1503335026 + last_login: 1503413020 + emails: + - email: mariano@jimenez.com + verified: true + purpose: primary + username: user-1 + given_name: Mariano + family_name: Jimenez + picture_url: https://avatars2.githubusercontent.com/u/14579210 + locale: en + country_code: UK + "409": + description: Trying setting an unverified email as the primary + content: {} + "411": + description: The request has a body but it doesn't have a Content-Length + header. + content: {} + "422": + description: All the custom errors that are generated from the Cycloid API headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30899,8 +30369,67 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - code: Unauthenticated - message: invalid credentials + - message: some error + code: SomeCode + "503": + description: The operation couldn't be executed or completed and it should + retried. + headers: + Retry-After: + description: The number of seconds to wait until retry the request + schema: + type: integer + format: uint16 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - code: RetryOperation + message: Operation must be retried. + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' + example: + errors: + - message: Server Internal error + code: Unexpected + x-codegen-request-body-name: body + post: + tags: + - User + description: Create a new User (sign-up). + operationId: signUp + requestBody: + description: The user content + content: + application/vnd.cycloid.io.v1+json: + schema: + $ref: '#/components/schemas/NewUserAccount' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/NewUserAccount' + required: true + responses: + "204": + description: Account created. The account MUST be verified through the link + sent to the email address. + content: {} + "411": + description: The request has a body but it doesn't have a Content-Length + header. + content: {} "422": description: All the custom errors that are generated from the Cycloid API headers: @@ -30936,55 +30465,35 @@ paths: code: Unexpected security: [] x-codegen-request-body-name: body - /user/{social_type}/oauth: - get: + delete: tags: - User - description: "Used to know if a user from the platform exists on that 'social_type'.\ - \ If it exists we'll return the JWT 'token', if it does not we'll return the\ - \ data of that user on the 'user' so it can be confirmed and created" - operationId: getOAuthUser - parameters: - - name: social_type - in: path - description: The OAuth Social type - required: true - schema: - type: string - enum: - - azuread - - saml2 - - google - - github - - name: oauth_code - in: query - description: The OAuth code returned form the Social Provider - required: true - schema: - type: string + description: The authenticated user delete itself from the system. + operationId: deleteUserAccount responses: - "200": - description: Used to know if a user from the platform exists on that 'social_type'. + "204": + description: User account has been deleted. + content: {} + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 content: application/json: schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/UserOAuth' + $ref: '#/components/schemas/ErrorPayload' example: - data: - user: - email: some@email.com - given_name: some name - username: some-name - picture_url: https://via.placeholder.com/150?text=cycloid.io - social_id: some-random-id - "401": - description: The user cannot be authenticated with the credentials which - she/he has used. + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + default: + description: "The response sent when an unexpected error happened, as known\ + \ as an internal server error." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -30997,8 +30506,25 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - code: Unauthenticated - message: invalid credentials + - message: Server Internal error + code: Unexpected + /user/aws_marketplace/entitlement: + post: + tags: + - User + description: | + This endpoint handles redirections from AWS Marketplace to our system. + If user doesn't exist, he'll be redirected to registration page. + If user exist, he'll be redirected to login page. + operationId: handleAWSMarketplaceUserEntitlement + responses: + "301": + description: The user is redirected based on his account state. + headers: + Location: + schema: + type: string + content: {} default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31017,51 +30543,33 @@ paths: - message: Server Internal error code: Unexpected security: [] + /user/aws_marketplace: post: tags: - User - description: Create a user from the OAuth 'social_type' - operationId: createOAuthUser - parameters: - - name: social_type - in: path - description: The OAuth Social type - required: true - schema: - type: string - enum: - - azuread - - saml2 - - google - - github + description: Create a new AWS Marketplace User. + operationId: signUpAWSMarketplace requestBody: description: The user content content: application/vnd.cycloid.io.v1+json: schema: - $ref: '#/components/schemas/NewOAuthUser' + $ref: '#/components/schemas/NewAWSMarketplaceUserAccount' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/NewOAuthUser' + $ref: '#/components/schemas/NewAWSMarketplaceUserAccount' required: true responses: - "200": - description: Create a user from the OAuth 'social_type' - content: - application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/UserSession' - example: - data: - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9LCJvcmdhbml6YXRpb24iOnsiaWQiOjIsImNhbm9uaWNhbCI6Im9yZzIiLCJuYW1lIjoiT3JnIDIifSwicGVybWlzc2lvbnMiOnsib3JnYW5pemF0aW9uOmRlbGV0ZSI6WyIxIl0sIm9yZ2FuaXphdGlvbjp1cGRhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpyZWFkIjpbXSwib3JnYW5pemF0aW9uOnRlYW06ZGVsZXRlIjpbIjIiXSwib3JnYW5pemF0aW9uOm1lbWJlcjpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOnJlYWQiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOmRlbGV0ZSI6W10sIm9yZ2FuaXphdGlvbjpwcm9qZWN0OnJlYWQiOltdfX19.CHA3146UEHwVW6nYkDgYeSukGeZIH55mi4O0LsemenA - "401": - description: The user cannot be authenticated with the credentials which - she/he has used. + "204": + description: Account created. The account MUST be verified through the link + sent to the email address. + content: {} + "411": + description: The request has a body but it doesn't have a Content-Length + header. + content: {} + "422": + description: All the custom errors that are generated from the Cycloid API headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31074,8 +30582,8 @@ paths: $ref: '#/components/schemas/ErrorPayload' example: errors: - - code: Unauthenticated - message: invalid credentials + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31095,53 +30603,221 @@ paths: code: Unexpected security: [] x-codegen-request-body-name: body - /user/refresh_token: + /organizations/{organization_canonical}/members: get: tags: - - User - description: "Refresh the user JWT and returns a new one if the previous is\ - \ valid. The 'organization_canonical_query' has to be of an organization in\ - \ which the user belongs to, and the 'child_canonical_query' of a child of\ - \ the 'organization_canonical_query' in any level (could be of a grand child)." - operationId: refreshToken + - Organization members + description: Get the members of an organization. + operationId: getOrgMembers parameters: - - name: organization_canonical - in: query - description: A canonical of a organization used for filtering. - schema: - $ref: '#/components/schemas/Canonical' - - name: child_canonical - in: query - description: A canonical of a child organization used for filtering. - schema: - $ref: '#/components/schemas/Canonical' + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + - name: page_index + in: query + description: The page number to request. The first page is 1. + schema: + type: integer + format: uint32 + default: 1 + - name: page_size + in: query + description: The number of items at most which the response can have. + schema: + type: integer + format: uint32 + default: 1000 + - name: invitation_state + in: query + description: Search by Invitation's state + schema: + type: string + enum: + - accepted + - pending + - declined + - name: user_given_name + in: query + description: Search by the user's given name + schema: + type: string + - name: user_family_name + in: query + description: Search by the user's family name + schema: + type: string + - name: role_name + in: query + description: Search by the role's name + schema: + type: string + - name: user_canonical + in: query + description: Search by the user canonical + schema: + type: string + - name: user_created_at + in: query + description: Search by user creation date + schema: + type: integer + format: uint64 + - name: member_created_at + in: query + description: Search by member joining date + schema: + type: integer + format: uint64 + - name: order_by + in: query + description: | + Allows to order the list of items. Example usage: field_name:asc + schema: + type: string responses: "200": - description: The token which represents the session of the user. + description: List of the members of the organization. content: - application/json: + '*/*': schema: required: - - data + - data + - pagination type: object properties: data: - $ref: '#/components/schemas/UserSession' + type: array + items: + $ref: '#/components/schemas/MemberOrg' + pagination: + $ref: '#/components/schemas/Pagination' + application/json: example: data: - owns: - - organization:seraf:team:teamcan - permissions: - organization:team:create: - id: 21 - effect: allow - action: organization:team:read - resources: - - organization:org-can:team:team-can - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9LCJvcmdhbml6YXRpb24iOnsiaWQiOjIsImNhbm9uaWNhbCI6Im9yZzIiLCJuYW1lIjoiT3JnIDIifSwicGVybWlzc2lvbnMiOnsib3JnYW5pemF0aW9uOmRlbGV0ZSI6WyIxIl0sIm9yZ2FuaXphdGlvbjp1cGRhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpyZWFkIjpbXSwib3JnYW5pemF0aW9uOnRlYW06ZGVsZXRlIjpbIjIiXSwib3JnYW5pemF0aW9uOm1lbWJlcjpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOnJlYWQiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOmRlbGV0ZSI6W10sIm9yZ2FuaXphdGlvbjpwcm9qZWN0OnJlYWQiOltdfX19.CHA3146UEHwVW6nYkDgYeSukGeZIH55mi4O0LsemenA - "401": - description: The user cannot be authenticated with the credentials which - she/he has used. + - username: user-1 + id: 1 + given_name: Mariano + family_name: Jimenez + invitation_email: jordi.capdevila@fakeemail.com + email: mariano.jimenez@fakeemail.com + picture_url: https://avatars2.githubusercontent.com/u/14579210 + created_at: 1503225026 + invitation_state: accepted + last_login_at: 1503225576 + role: + id: 17 + name: existing + description: Organization existing role + canonical: role-can + rules: + - id: 1 + effect: allow + action: organization:delete + resources: + - organization:org-can + - organization:org-can2 + - id: 20 + effect: allow + action: organization:team:create + resources: [] + - id: 21 + effect: allow + action: organization:team:read + resources: + - organization:org-can:team:team-can + - username: user2 + id: 1 + given_name: Jordi + family_name: Capdevila + invitation_email: jordi.capdevila@fakeemail.com + email: jordi.capdevila@fakeemail.com + picture_url: https://avatars2.githubusercontent.com/u/14579210 + created_at: 1503281026 + last_login_at: 1503225576 + invitation_state: accepted + role: + id: 17 + name: existing + description: Organization existing role + canonical: role-can + rules: + - id: 1 + effect: allow + action: organization:delete + resources: + - organization:org-can + - organization:org-can2 + - id: 20 + effect: allow + action: organization:team:create + resources: [] + - id: 21 + effect: allow + action: organization:team:read + resources: + - organization:org-can:team:team-can + - username: user-3 + id: 1 + given_name: Ivan + family_name: Drago + invitation_email: jordi.capdevila@fakeemail.com + email: ivan.drago@fakeemail.com + picture_url: https://avatars2.githubusercontent.com/u/14579210 + created_at: 1502225026 + last_login_at: 1503225576 + invitation_state: accepted + role: + id: 17 + name: existing + description: Organization existing role + canonical: role-can + rules: + - id: 1 + effect: allow + action: organization:delete + resources: + - organization:org-can + - organization:org-can2 + - id: 20 + effect: allow + action: organization:team:create + resources: [] + - id: 21 + effect: allow + action: organization:team:read + resources: + - organization:org-can:team:team-can + pagination: + index: 1 + size: 10 + total: 3 + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + '*/*': + schema: + $ref: '#/components/schemas/ErrorPayload' + application/json: + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31149,13 +30825,31 @@ paths: type: integer format: uint64 content: + '*/*': + schema: + $ref: '#/components/schemas/ErrorPayload' application/json: + example: + errors: + - message: Entity not found + code: NotFoundEntity + "422": + description: All the custom errors that are generated from the Cycloid API + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - code: Unauthenticated - message: invalid credentials + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31166,36 +30860,85 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected - /user/reset_password: - put: + - message: Server Internal error + code: Unexpected + post: tags: - - User - description: "Reset the user password when it has been forgotten. Due to security\ - \ reasons, the endpoint doesn't return a Unprocessable Entity (422) when the\ - \ token is invalid. 404 Status code is returned if the user has been deleted\ - \ of the system between the user password request and this request." - operationId: passwordResetUpdate + - Organization members + description: Invite a user to be a member of the organization. + operationId: inviteUserToOrgMember + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string requestBody: - description: The reset password payload + description: The user's member invitation. content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/UserPasswordResetUpdate' - application/x-www-form-urlencoded: + '*/*': schema: - $ref: '#/components/schemas/UserPasswordResetUpdate' + $ref: '#/components/schemas/NewMemberInvitation' required: true responses: - "204": - description: The password has been changed. - content: {} + "200": + description: The information of the member of the organization. + content: + '*/*': + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/MemberOrg' + application/json: + example: + data: + id: 1 + username: user2 + given_name: Jordi + family_name: Capdevila + invitation_email: jordi.capdevila@fakeemail.com + email: jordi.capdevila@fakeemail.com + picture_url: https://avatars2.githubusercontent.com/u/14579210 + created_at: 1503281026 + invitation_state: accepted + role: + id: 2 + name: project manager + description: A project manager + policies: + - id: 21 + code: team:read + entities: [] + description: Grant the access to read the teams of an organization + - id: 22 + code: team:edit + entities: [] + description: Grant the access to edit teams + - id: 60 + code: project:read + entities: [] + description: Grant the access to projects + - id: 61 + code: project:create + entities: [] + description: Grant the access to create a project in the organization + - id: 62 + code: project:edit + entities: [] + description: Grant the access to edit projects "404": description: The response sent when any of the entities present in the path is not found. @@ -31206,13 +30949,18 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Entity not found - code: NotFoundEntity + - message: Entity not found + code: NotFoundEntity + "411": + description: The request has a body but it doesn't have a Content-Length + header. + content: {} "422": description: All the custom errors that are generated from the Cycloid API headers: @@ -31222,13 +30970,14 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: some error - code: SomeCode + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31239,38 +30988,90 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected - security: [] + - message: Server Internal error + code: Unexpected x-codegen-request-body-name: body - post: + /organizations/{organization_canonical}/members/{member_id}: + get: tags: - - User - description: "Request to reset the password. Due to security reasons, this endpoint\ - \ doesn't return Not Found (404) when the email doesn't exist or belongs to\ - \ a user primary email." - operationId: passwordResetReq - requestBody: - description: The reset password payload - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/UserPasswordResetReq' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserPasswordResetReq' - required: true + - Organization members + description: Get the information of a member of the organization. + operationId: getOrgMember + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + - name: member_id + in: path + description: A member id + required: true + schema: + type: integer + format: uint32 responses: - "204": - description: The password has been changed. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API + "200": + description: The information of the member of the organization. + content: + '*/*': + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/MemberOrg' + application/json: + example: + data: + id: 1 + username: user2 + given_name: Jordi + family_name: Capdevila + invitation_email: jordi.capdevila@fakeemail.com + email: jordi.capdevila@fakeemail.com + picture_url: https://avatars2.githubusercontent.com/u/14579210 + created_at: 1503281026 + invitation_state: accepted + role: + id: 2 + name: project manager + description: A project manager + policies: + - id: 21 + code: team:read + entities: [] + description: Grant the access to read the teams of an organization + - id: 22 + code: team:edit + entities: [] + description: Grant the access to edit teams + - id: 60 + code: project:read + entities: [] + description: Grant the access to projects + - id: 61 + code: project:create + entities: [] + description: Grant the access to create a project in the organization + - id: 62 + code: project:edit + entities: [] + description: Grant the access to edit projects + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31278,13 +31079,32 @@ paths: type: integer format: uint64 content: + '*/*': + schema: + $ref: '#/components/schemas/ErrorPayload' application/json: + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: some error - code: SomeCode + - message: Entity not found + code: NotFoundEntity default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31295,67 +31115,95 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected - security: [] - x-codegen-request-body-name: body - /user: - get: + - message: Server Internal error + code: Unexpected + put: tags: - - User - description: Get the information of the account of the authenticated user. - operationId: getUserAccount + - Organization members + description: Update member of the organization. + operationId: updateOrgMember + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + - name: member_id + in: path + description: A member id + required: true + schema: + type: integer + format: uint32 + requestBody: + description: The member information to be updated. + content: + '*/*': + schema: + $ref: '#/components/schemas/MemberAssignation' + required: true responses: "200": - description: The user account information. + description: The information of the member of the organization. content: - application/json: + '*/*': schema: required: - - data + - data type: object properties: data: - $ref: '#/components/schemas/UserAccount' + $ref: '#/components/schemas/MemberOrg' + application/json: example: data: - created_at: 1503225026 - updated_at: 1503335026 - last_login: 1503413020 - emails: - - email: mariano@jimenez.com - verified: true - purpose: primary - username: user-1 - given_name: Mariano - family_name: Jimenez + id: 1 + username: user2 + given_name: Jordi + family_name: Capdevila + invitation_email: jordi.capdevila@fakeemail.com + email: jordi.capdevila@fakeemail.com picture_url: https://avatars2.githubusercontent.com/u/14579210 - locale: en - country: - code: GB - name: United Kingdom - guide: - tutorial: - welcome: false - letsgo: false - credentials: false - createProject: false - selectStack: false - configEnv: false - customEnvConfig: false - reviewDeploy: false - deployed: false - tasksDetails: false - finish: false - presentation: false - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." + created_at: 1503281026 + invitation_state: accepted + role: + id: 2 + name: project manager + description: A project manager + policies: + - id: 21 + code: team:read + entities: [] + description: Grant the access to read the teams of an organization + - id: 22 + code: team:edit + entities: [] + description: Grant the access to edit teams + - id: 60 + code: project:read + entities: [] + description: Grant the access to projects + - id: 61 + code: project:create + entities: [] + description: Grant the access to create a project in the organization + - id: 62 + code: project:edit + entities: [] + description: Grant the access to edit projects + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31363,64 +31211,17 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' - example: - errors: - - message: Server Internal error - code: Unexpected - put: - tags: - - User - description: Update the information of the account of the authenticated user. - operationId: updateUserAccount - requestBody: - description: The user content - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/UpdateUserAccount' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UpdateUserAccount' - required: true - responses: - "200": - description: The updated user profile information. - content: application/json: - schema: - required: - - data - type: object - properties: - data: - $ref: '#/components/schemas/UserAccount' example: - data: - created_at: 1503225026 - updated_at: 1503335026 - last_login: 1503413020 - emails: - - email: mariano@jimenez.com - verified: true - purpose: primary - username: user-1 - given_name: Mariano - family_name: Jimenez - picture_url: https://avatars2.githubusercontent.com/u/14579210 - locale: en - country_code: UK - "409": - description: Trying setting an unverified email as the primary - content: {} - "411": - description: The request has a body but it doesn't have a Content-Length - header. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31428,30 +31229,31 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: some error - code: SomeCode - "503": - description: The operation couldn't be executed or completed and it should - retried. + - message: Entity not found + code: NotFoundEntity + "422": + description: All the custom errors that are generated from the Cycloid API headers: - Retry-After: - description: The number of seconds to wait until retry the request + Content-Length: + description: The length of the response body in octets (8-bit bytes). schema: type: integer - format: uint16 + format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - code: RetryOperation - message: Operation must be retried. + - message: some error + code: SomeCode default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31462,40 +31264,44 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected + - message: Server Internal error + code: Unexpected x-codegen-request-body-name: body - post: + delete: tags: - - User - description: Create a new User (sign-up). - operationId: signUp - requestBody: - description: The user content - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/NewUserAccount' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NewUserAccount' - required: true + - Organization members + description: Remove a member of the organization. + operationId: removeOrgMember + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + - name: member_id + in: path + description: A member id + required: true + schema: + type: integer + format: uint32 responses: "204": - description: Account created. The account MUST be verified through the link - sent to the email address. - content: {} - "411": - description: The request has a body but it doesn't have a Content-Length - header. + description: Member has been removed. content: {} - "422": - description: All the custom errors that are generated from the Cycloid API + "403": + description: "The authenticated user cannot perform the operation because,\ + \ it doesn't have permissions for such operation." headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31503,13 +31309,32 @@ paths: type: integer format: uint64 content: + '*/*': + schema: + $ref: '#/components/schemas/ErrorPayload' application/json: + example: + errors: + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. + headers: + Content-Length: + description: The length of the response body in octets (8-bit bytes). + schema: + type: integer + format: uint64 + content: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: some error - code: SomeCode + - message: Entity not found + code: NotFoundEntity default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31520,23 +31345,41 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected - security: [] - x-codegen-request-body-name: body - delete: + - message: Server Internal error + code: Unexpected + /organizations/{organization_canonical}/members/{member_id}/resend: + put: tags: - - User - description: The authenticated user delete itself from the system. - operationId: deleteUserAccount + - Organization members + description: Resend the email containing the verification token to accept the + member Invitation. + operationId: resendMemberInvitation + parameters: + - name: organization_canonical + in: path + description: A canonical of an organization. + required: true + schema: + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + - name: member_id + in: path + description: A member id + required: true + schema: + type: integer + format: uint32 responses: "204": - description: User account has been deleted. + description: The member Invitation has been resent. content: {} "403": description: "The authenticated user cannot perform the operation because,\ @@ -31548,16 +31391,17 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Not enough permissions to perform the operation - code: Unauthorized - default: - description: "The response sent when an unexpected error happened, as known\ - \ as an internal server error." + - message: Not enough permissions to perform the operation + code: Unauthorized + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31565,30 +31409,14 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected - /user/aws_marketplace/entitlement: - post: - tags: - - User - description: | - This endpoint handles redirections from AWS Marketplace to our system. - If user doesn't exist, he'll be redirected to registration page. - If user exist, he'll be redirected to login page. - operationId: handleAWSMarketplaceUserEntitlement - responses: - "301": - description: The user is redirected based on his account state. - headers: - Location: - schema: - type: string - content: {} + - message: Entity not found + code: NotFoundEntity default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31599,41 +31427,48 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected + - message: Server Internal error + code: Unexpected security: [] - /user/aws_marketplace: - post: + /members/verify/{verification_token}: + get: tags: - - User - description: Create a new AWS Marketplace User. - operationId: signUpAWSMarketplace - requestBody: - description: The user content - content: - application/vnd.cycloid.io.v1+json: - schema: - $ref: '#/components/schemas/NewAWSMarketplaceUserAccount' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NewAWSMarketplaceUserAccount' - required: true + - Organization members + description: Get the email address used for the pending member invitation + operationId: getPendingMemberInvitation + parameters: + - name: verification_token + in: path + description: "A token for verifying emails, invitations, etc." + required: true + schema: + minLength: 5 + type: string responses: - "204": - description: Account created. The account MUST be verified through the link - sent to the email address. - content: {} - "411": - description: The request has a body but it doesn't have a Content-Length - header. - content: {} - "422": - description: All the custom errors that are generated from the Cycloid API + "200": + description: The email address used for the pending member invitation + content: + '*/*': + schema: + required: + - data + type: object + properties: + data: + $ref: '#/components/schemas/PendingMemberInvitation' + application/json: + example: + data: + email: user@user.com + "404": + description: The response sent when any of the entities present in the path + is not found. headers: Content-Length: description: The length of the response body in octets (8-bit bytes). @@ -31641,13 +31476,14 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: some error - code: SomeCode + - message: Entity not found + code: NotFoundEntity default: description: "The response sent when an unexpected error happened, as known\ \ as an internal server error." @@ -31658,17 +31494,27 @@ paths: type: integer format: uint64 content: - application/json: + '*/*': schema: $ref: '#/components/schemas/ErrorPayload' + application/json: example: errors: - - message: Server Internal error - code: Unexpected + - message: Server Internal error + code: Unexpected security: [] - x-codegen-request-body-name: body components: schemas: + PendingMemberInvitation: + title: PendingMemberInvitation + description: Contains the email used for the member invitation + type: object + required: + - email + properties: + email: + type: string + format: email TerraformProviderCycloid: title: TerraformProviderCycloid required: @@ -39266,7 +39112,18 @@ components: description: The canonical of the service you want to get the status from required: true schema: - $ref: '#/components/schemas/Canonical' + maxLength: 100 + minLength: 3 + pattern: "^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$" + type: string + member_id: + name: member_id + description: A member id + in: path + required: true + schema: + type: integer + format: uint32 securitySchemes: api_key: type: apiKey diff --git a/out_code_spec.json b/out_code_spec.json index aedf1db..16302f8 100644 --- a/out_code_spec.json +++ b/out_code_spec.json @@ -1268,6 +1268,91 @@ } ] } + }, + { + "name": "organization_member", + "schema": { + "attributes": [ + { + "name": "email", + "string": { + "computed_optional_required": "required", + "description": "Invite user by email" + } + }, + { + "name": "role_canonical", + "string": { + "computed_optional_required": "required", + "description": "The canonical of an entity", + "validators": [ + { + "custom": { + "imports": [ + { + "path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + } + ], + "schema_definition": "stringvalidator.LengthBetween(3, 100)" + } + }, + { + "custom": { + "imports": [ + { + "path": "regexp" + }, + { + "path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + } + ], + "schema_definition": "stringvalidator.RegexMatches(regexp.MustCompile(\"^[a-z0-9]+[a-z0-9\\\\-_]+[a-z0-9]+$\"), \"\")" + } + } + ] + } + }, + { + "name": "organization_canonical", + "string": { + "computed_optional_required": "computed_optional", + "description": "A canonical of an organization.", + "validators": [ + { + "custom": { + "imports": [ + { + "path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + } + ], + "schema_definition": "stringvalidator.LengthBetween(3, 100)" + } + }, + { + "custom": { + "imports": [ + { + "path": "regexp" + }, + { + "path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + } + ], + "schema_definition": "stringvalidator.RegexMatches(regexp.MustCompile(\"^[a-z0-9]+[a-z0-9\\\\-_]+[a-z0-9]+$\"), \"\")" + } + } + ] + } + }, + { + "name": "member_id", + "int64": { + "computed_optional_required": "computed_optional", + "description": "A member id" + } + } + ] + } } ], "version": "0.1" diff --git a/provider/external_backend_resource.go b/provider/external_backend_resource.go index 94fbde3..d686a1e 100644 --- a/provider/external_backend_resource.go +++ b/provider/external_backend_resource.go @@ -271,12 +271,25 @@ func (r *externalBackendResource) Update(ctx context.Context, req resource.Updat return } + ebID := data.ExternalBackendId.ValueInt64() + + // If there's no ebID, try to get it from the prior state + if ebID == 0 { + var plandata externalBackendResourceModel + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &plandata)...) + if resp.Diagnostics.HasError() { + return + } + ebID = plandata.ExternalBackendId.ValueInt64() + } + var ( eb *models.ExternalBackend err error ) - eb, err = mid.GetExternalBackend(orgCan, uint32(data.ExternalBackendId.ValueInt64())) + eb, err = mid.GetExternalBackend(orgCan, uint32(ebID)) if err != nil { resp.Diagnostics.AddError( "Unable read external backend", diff --git a/provider/organization_member_resource.go b/provider/organization_member_resource.go new file mode 100644 index 0000000..b006043 --- /dev/null +++ b/provider/organization_member_resource.go @@ -0,0 +1,197 @@ +package provider + +import ( + "context" + + "github.com/cycloidio/cycloid-cli/client/models" + "github.com/cycloidio/cycloid-cli/cmd/cycloid/common" + "github.com/cycloidio/cycloid-cli/cmd/cycloid/middleware" + "github.com/cycloidio/terraform-provider-cycloid/provider_cycloid" + "github.com/cycloidio/terraform-provider-cycloid/resource_organization_member" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +var _ resource.Resource = (*organizationMemberResource)(nil) + +func NewOrganizationMemberResource() resource.Resource { + return &organizationMemberResource{} +} + +type organizationMemberResource struct { + provider provider_cycloid.CycloidModel +} + +type organizationMemberResourceModel resource_organization_member.OrganizationMemberModel + +func (r *organizationMemberResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_organization_member" +} + +func (r *organizationMemberResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = resource_organization_member.OrganizationMemberResourceSchema(ctx) +} + +func (r *organizationMemberResource) Configure(ctx context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + pv, ok := req.ProviderData.(provider_cycloid.CycloidModel) + if !ok { + tflog.Error(ctx, "Unable to prepare client") + return + } + r.provider = pv +} + +func (r *organizationMemberResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data organizationMemberResourceModel + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + api := common.NewAPI(common.WithURL(r.provider.Url.ValueString()), common.WithToken(r.provider.Jwt.ValueString())) + mid := middleware.NewMiddleware(api) + + email := data.Email.ValueString() + role := data.RoleCanonical.ValueString() + + orgCan := getOrganizationCanonical(r.provider, data.OrganizationCanonical) + + m, err := mid.InviteMember(orgCan, email, role) + if err != nil { + resp.Diagnostics.AddError( + "Unable create member", + err.Error(), + ) + return + } + + orgMemberCYModelToData(orgCan, m, &data) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func orgMemberCYModelToData(org string, m *models.MemberOrg, data *organizationMemberResourceModel) diag.Diagnostics { + var diags diag.Diagnostics + + email := m.Email + if m.InvitationState == "pending" { + email = m.InvitationEmail + } + + data.OrganizationCanonical = types.StringValue(org) + data.MemberId = types.Int64Value(int64(*m.ID)) + data.Email = types.StringValue(string(email)) + data.RoleCanonical = types.StringValue(*m.Role.Canonical) + + return diags +} + +func (r *organizationMemberResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var data organizationMemberResourceModel + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + api := common.NewAPI(common.WithURL(r.provider.Url.ValueString()), common.WithToken(r.provider.Jwt.ValueString())) + mid := middleware.NewMiddleware(api) + + memberID := data.MemberId + orgCan := getOrganizationCanonical(r.provider, data.OrganizationCanonical) + + m, err := mid.GetMember(orgCan, uint32(memberID.ValueInt64())) + if err != nil { + resp.Diagnostics.AddError( + "Unable read member", + err.Error(), + ) + return + } + + orgMemberCYModelToData(orgCan, m, &data) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func (r *organizationMemberResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var data organizationMemberResourceModel + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + api := common.NewAPI(common.WithURL(r.provider.Url.ValueString()), common.WithToken(r.provider.Jwt.ValueString())) + mid := middleware.NewMiddleware(api) + + orgCan := getOrganizationCanonical(r.provider, data.OrganizationCanonical) + memberID := data.MemberId.ValueInt64() + roleCan := data.RoleCanonical.ValueString() + + // If there's no memberID, try to get it from the prior state + if memberID == 0 { + var plandata organizationMemberResourceModel + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &plandata)...) + if resp.Diagnostics.HasError() { + return + } + memberID = plandata.MemberId.ValueInt64() + } + + m, err := mid.UpdateMember(orgCan, uint32(memberID), roleCan) + if err != nil { + resp.Diagnostics.AddError( + "Unable update member", + err.Error(), + ) + return + } + + orgMemberCYModelToData(orgCan, m, &data) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func (r *organizationMemberResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var data organizationMemberResourceModel + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + api := common.NewAPI(common.WithURL(r.provider.Url.ValueString()), common.WithToken(r.provider.Jwt.ValueString())) + mid := middleware.NewMiddleware(api) + + memberID := data.MemberId.ValueInt64() + orgCan := getOrganizationCanonical(r.provider, data.OrganizationCanonical) + + err := mid.DeleteMember(orgCan, uint32(memberID)) + if err != nil { + resp.Diagnostics.AddError( + "Unable delete member", + err.Error(), + ) + return + } +} diff --git a/provider/provider.go b/provider/provider.go index 77de1d1..4cab63f 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -52,5 +52,6 @@ func (p *cycloidProvider) Resources(ctx context.Context) []func() resource.Resou NewCatalogRepositoryResource, NewConfigRepositoryResource, NewExternalBackendResource, + NewOrganizationMemberResource, } } diff --git a/resource_organization_member/organization_member_resource_gen.go b/resource_organization_member/organization_member_resource_gen.go new file mode 100644 index 0000000..1c6affb --- /dev/null +++ b/resource_organization_member/organization_member_resource_gen.go @@ -0,0 +1,57 @@ +// Code generated by terraform-plugin-framework-generator DO NOT EDIT. + +package resource_organization_member + +import ( + "context" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "regexp" + + "github.com/hashicorp/terraform-plugin-framework/resource/schema" +) + +func OrganizationMemberResourceSchema(ctx context.Context) schema.Schema { + return schema.Schema{ + Attributes: map[string]schema.Attribute{ + "email": schema.StringAttribute{ + Required: true, + Description: "Invite user by email", + MarkdownDescription: "Invite user by email", + }, + "member_id": schema.Int64Attribute{ + Optional: true, + Computed: true, + Description: "A member id", + MarkdownDescription: "A member id", + }, + "organization_canonical": schema.StringAttribute{ + Optional: true, + Computed: true, + Description: "A canonical of an organization.", + MarkdownDescription: "A canonical of an organization.", + Validators: []validator.String{ + stringvalidator.LengthBetween(3, 100), + stringvalidator.RegexMatches(regexp.MustCompile("^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$"), ""), + }, + }, + "role_canonical": schema.StringAttribute{ + Required: true, + Description: "The canonical of an entity", + MarkdownDescription: "The canonical of an entity", + Validators: []validator.String{ + stringvalidator.LengthBetween(3, 100), + stringvalidator.RegexMatches(regexp.MustCompile("^[a-z0-9]+[a-z0-9\\-_]+[a-z0-9]+$"), ""), + }, + }, + }, + } +} + +type OrganizationMemberModel struct { + Email types.String `tfsdk:"email"` + MemberId types.Int64 `tfsdk:"member_id"` + OrganizationCanonical types.String `tfsdk:"organization_canonical"` + RoleCanonical types.String `tfsdk:"role_canonical"` +}