From e8ba7650f768f92d07bc937cc388622c230efa6a Mon Sep 17 00:00:00 2001 From: Melvin <70433111+MelvinKl@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:01:54 +0200 Subject: [PATCH 1/3] feat: add python sdk (#29) --- .github/workflows/sdk-pr.yaml | 56 +++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sdk-pr.yaml b/.github/workflows/sdk-pr.yaml index dd950b3..ebc2cb9 100644 --- a/.github/workflows/sdk-pr.yaml +++ b/.github/workflows/sdk-pr.yaml @@ -11,8 +11,8 @@ env: JAVA_VERSION: "11" jobs: - main: - name: Update SDK Repo + main-go: + name: [Go] Update SDK Repo runs-on: ubuntu-latest steps: - name: Install SSH Key @@ -49,4 +49,54 @@ jobs: GH_REPO: "stackitcloud/stackit-sdk-go" GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }} run: | - scripts/sdk-create-pr.sh "oas-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" + scripts/sdk-create-pr.sh "oas-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" + main-python: + name: [Python] Update SDK Repo + runs-on: ubuntu-latest + steps: + - name: Install SSH Key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + known_hosts: ${{ vars.SSH_KNOWN_HOSTS }} + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: ${{ env.JAVA_VERSION }} + - name: Checkout generator repo + uses: actions/checkout@v3 + with: + repository: "stackitcloud/stackit-sdk-generator" + ref: "main" + - name: Build + uses: ./.github/actions/build + with: + go-version: ${{ env.GO_VERSION }} + - name: Download OAS + run: make download-oas + - name: Generate SDK + run: make generate-sdk LANGUAGE=python + - uses: actions/checkout@v3 + with: + repository: "stackitcloud/stackit-sdk-python-core" + ref: "main" + path: 'python-core' + - name: Install Python SDK Core + working-directory: 'python-core' + run: make install + - name: Install Python SDK + working-directory: ./sdk-repo-updated + run: make install-dev + - name: Lint Python + working-directory: ./sdk-repo-updated + run: make lint + - name: Test Python + working-directory: ./sdk-repo-updated + run: make test + - name: Push Python SDK + env: + GH_REPO: "stackitcloud/stackit-sdk-python" + GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }} + run: | + scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" "git@github.com:stackitcloud/stackit-sdk-python.git" "python" From 523870577970054c135fa2be7f757e5b6991ca28 Mon Sep 17 00:00:00 2001 From: OAS Bot Date: Mon, 28 Oct 2024 08:38:40 +0000 Subject: [PATCH 2/3] OAS Update --- services/iaas/v1alpha1/iaas.json | 535 ++++++++++++++++++++++++++++++- services/iaas/v1beta1/iaas.json | 8 +- 2 files changed, 535 insertions(+), 8 deletions(-) diff --git a/services/iaas/v1alpha1/iaas.json b/services/iaas/v1alpha1/iaas.json index 026408b..f92e33a 100644 --- a/services/iaas/v1alpha1/iaas.json +++ b/services/iaas/v1alpha1/iaas.json @@ -128,6 +128,15 @@ "$ref": "#/components/schemas/ServiceAccountMail" } }, + "v1VirtualIPID": { + "description": "The identifier (ID) of a Virtual IP.", + "in": "path", + "name": "virtualIpId", + "required": true, + "schema": { + "$ref": "#/components/schemas/UUID" + } + }, "v1VolumeID": { "description": "The identifier (ID) of a STACKIT Volume.", "in": "path", @@ -339,6 +348,18 @@ } }, "schemas": { + "AddMemberToVirtualIPPayload": { + "description": "Object that represents a virtual IP member.", + "properties": { + "member": { + "$ref": "#/components/schemas/UUID" + } + }, + "required": [ + "member" + ], + "type": "object" + }, "AddVolumeToServerPayload": { "description": "Object that represents a Volume attachment to a server.", "properties": { @@ -647,6 +668,14 @@ "CreateKeyPairPayload": { "description": "Object that represents the public key of an SSH keypair and its name.", "properties": { + "createdAt": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatedAt" + } + ], + "readOnly": true + }, "fingerprint": { "allOf": [ { @@ -663,6 +692,14 @@ }, "publicKey": { "$ref": "#/components/schemas/SSHPublicKey" + }, + "updatedAt": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatedAt" + } + ], + "readOnly": true } }, "required": [ @@ -1070,6 +1107,48 @@ ], "type": "object" }, + "CreateVirtualIPPayload": { + "description": "Object that represents a virtual IP.", + "properties": { + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/UUID" + } + ], + "readOnly": true + }, + "ip": { + "$ref": "#/components/schemas/IP" + }, + "labels": { + "$ref": "#/components/schemas/Labels" + }, + "members": { + "$ref": "#/components/schemas/UUIDList" + }, + "name": { + "$ref": "#/components/schemas/GenericName" + }, + "network": { + "allOf": [ + { + "$ref": "#/components/schemas/UUID" + } + ], + "readOnly": true + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/ResourceState" + } + ], + "readOnly": true + } + }, + "type": "object" + }, "CreateVolumePayload": { "description": "Object that represents a volume and its parameters. Used for Creating and returning (get/list).", "properties": { @@ -1263,6 +1342,14 @@ "Keypair": { "description": "Object that represents the public key of an SSH keypair and its name.", "properties": { + "createdAt": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatedAt" + } + ], + "readOnly": true + }, "fingerprint": { "allOf": [ { @@ -1279,6 +1366,14 @@ }, "publicKey": { "$ref": "#/components/schemas/SSHPublicKey" + }, + "updatedAt": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatedAt" + } + ], + "readOnly": true } }, "required": [ @@ -1678,7 +1773,7 @@ "type": "integer" }, "min": { - "description": "The minimum port number. Should be less or equal to the minimum.", + "description": "The minimum port number. Should be less or equal to the maximum.", "example": 22, "format": "int64", "maximum": 65535, @@ -1868,6 +1963,18 @@ ], "type": "object" }, + "RemoveMemberFromVirtualIPPayload": { + "description": "Object that represents a virtual IP member.", + "properties": { + "member": { + "$ref": "#/components/schemas/UUID" + } + }, + "required": [ + "member" + ], + "type": "object" + }, "ReqId": { "description": "Identifier (ID) representing a single API request.", "example": "req-d61a8564c8dd4ffbbc15143e7d0c85ed", @@ -2383,13 +2490,13 @@ }, "endsAt": { "description": "End of the maintenance window.", - "example": "2023-09-23T11:39:48.205Z", + "example": "2023-09-23T11:39:48Z", "format": "date-time", "type": "string" }, "startsAt": { "description": "Start of the maintenance window.", - "example": "2023-09-22T11:39:48.205Z", + "example": "2023-09-22T11:39:48Z", "format": "date-time", "type": "string" }, @@ -2704,6 +2811,26 @@ }, "type": "object" }, + "UpdateVirtualIPPayload": { + "description": "Object that represents a virtual IP update request body.", + "properties": { + "labels": { + "$ref": "#/components/schemas/Labels" + }, + "members": { + "allOf": [ + { + "$ref": "#/components/schemas/UUIDList" + } + ], + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/GenericName" + } + }, + "type": "object" + }, "UpdateVolumePayload": { "description": "Object that represents an update request body of a volume.", "properties": { @@ -2725,6 +2852,67 @@ "format": "date-time", "type": "string" }, + "VirtualIp": { + "description": "Object that represents a virtual IP.", + "properties": { + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/UUID" + } + ], + "readOnly": true + }, + "ip": { + "$ref": "#/components/schemas/IP" + }, + "labels": { + "$ref": "#/components/schemas/Labels" + }, + "members": { + "$ref": "#/components/schemas/UUIDList" + }, + "name": { + "$ref": "#/components/schemas/GenericName" + }, + "network": { + "allOf": [ + { + "$ref": "#/components/schemas/UUID" + } + ], + "readOnly": true + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/ResourceState" + } + ], + "readOnly": true + } + }, + "type": "object" + }, + "VirtualIpList": { + "description": "A list of virtual IPs.", + "items": { + "$ref": "#/components/schemas/VirtualIp" + }, + "type": "array" + }, + "VirtualIpListResponse": { + "description": "Virtual IPs list response.", + "properties": { + "items": { + "$ref": "#/components/schemas/VirtualIpList" + } + }, + "required": [ + "items" + ], + "type": "object" + }, "Volume": { "description": "Object that represents a volume and its parameters. Used for Creating and returning (get/list).", "properties": { @@ -3714,6 +3902,345 @@ "summary": "Update a network interface." } }, + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips": { + "get": { + "description": "Get a list of all virtual IPs inside a project.", + "operationId": "ListVirtualIPs", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + }, + { + "$ref": "#/components/parameters/v1LabelSelector" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VirtualIpListResponse" + } + } + }, + "description": "List project virtual IPs." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "List all virtual IPs inside a project." + }, + "post": { + "description": "Create a new virtual IP in a project.", + "operationId": "CreateVirtualIP", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVirtualIPPayload" + } + } + }, + "description": "Request a virtual IP creation.", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VirtualIp" + } + } + }, + "description": "Virtual IP create request accepted." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "Create new virtual IP." + } + }, + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}": { + "delete": { + "description": "Delete a virtual IP that is part of the project.", + "operationId": "DeleteVirtualIP", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + }, + { + "$ref": "#/components/parameters/v1VirtualIPID" + } + ], + "responses": { + "204": { + "description": "Virtual IP delete request accepted." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "Delete a virtual IP." + }, + "get": { + "description": "Get details about a virtual IP inside a project.", + "operationId": "GetVirtualIP", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + }, + { + "$ref": "#/components/parameters/v1VirtualIPID" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VirtualIp" + } + } + }, + "description": "Show virtual IP details." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "Get details about a virtual IP." + }, + "patch": { + "description": "Update the properties of an existing virtual IP inside a project.", + "operationId": "UpdateVirtualIP", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + }, + { + "$ref": "#/components/parameters/v1VirtualIPID" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateVirtualIPPayload" + } + } + }, + "description": "Request an update of a virtual IP.", + "required": true + }, + "responses": { + "202": { + "description": "Virtual IP update request accepted." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "Update a virtual IP." + } + }, + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/add-member": { + "put": { + "description": "Atomically add a member to the virtual IP.", + "operationId": "AddMemberToVirtualIP", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + }, + { + "$ref": "#/components/parameters/v1VirtualIPID" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddMemberToVirtualIPPayload" + } + } + }, + "description": "Request to add a member to a virtual IP.", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VirtualIp" + } + } + }, + "description": "Member has been added to the virtual IP." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "Add a member to the virtual IP." + } + }, + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member": { + "put": { + "description": "Atomically remove a member from the virtual IP.", + "operationId": "RemoveMemberFromVirtualIP", + "parameters": [ + { + "$ref": "#/components/parameters/v1ProjectID" + }, + { + "$ref": "#/components/parameters/v1NetworkID" + }, + { + "$ref": "#/components/parameters/v1VirtualIPID" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveMemberFromVirtualIPPayload" + } + } + }, + "description": "Request to remove a member from a virtual IP.", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VirtualIp" + } + } + }, + "description": "Member has been removed from the virtual IP." + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "summary": "Remove a member from the virtual IP." + } + }, "/v1alpha1/projects/{projectId}/public-ips": { "get": { "description": "Get a list of all public IPs inside a project.", @@ -4980,7 +5507,7 @@ }, "put": { "description": "Attach an existing network interface to a server.", - "operationId": "AddNICToServer", + "operationId": "AddNicToServer", "parameters": [ { "$ref": "#/components/parameters/v1ProjectID" diff --git a/services/iaas/v1beta1/iaas.json b/services/iaas/v1beta1/iaas.json index 581ed46..5e4a0d0 100644 --- a/services/iaas/v1beta1/iaas.json +++ b/services/iaas/v1beta1/iaas.json @@ -1734,7 +1734,7 @@ "type": "integer" }, "min": { - "description": "The minimum port number. Should be less or equal to the minimum.", + "description": "The minimum port number. Should be less or equal to the maximum.", "example": 22, "format": "int64", "maximum": 65535, @@ -2371,13 +2371,13 @@ }, "endsAt": { "description": "End of the maintenance window.", - "example": "2023-09-23T11:39:48.205Z", + "example": "2023-09-23T11:39:48Z", "format": "date-time", "type": "string" }, "startsAt": { "description": "Start of the maintenance window.", - "example": "2023-09-22T11:39:48.205Z", + "example": "2023-09-22T11:39:48Z", "format": "date-time", "type": "string" }, @@ -5466,7 +5466,7 @@ }, "put": { "description": "Attach an existing network interface to a server.", - "operationId": "AddNICToServer", + "operationId": "AddNicToServer", "parameters": [ { "$ref": "#/components/parameters/v1ProjectID" From 67b48166ced8252db4fdbba25173c4d97dce83f6 Mon Sep 17 00:00:00 2001 From: OAS Bot Date: Mon, 28 Oct 2024 11:45:18 +0000 Subject: [PATCH 3/3] OAS Update --- services/ske/v1/ske.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/ske/v1/ske.json b/services/ske/v1/ske.json index 2469ca3..c00aa40 100644 --- a/services/ske/v1/ske.json +++ b/services/ske/v1/ske.json @@ -460,7 +460,7 @@ "type": "integer" }, "memory": { - "title": "memory in GB", + "title": "memory in GiB", "type": "integer" }, "name": { @@ -709,7 +709,7 @@ "size": { "maximum": 10240, "minimum": 20, - "title": "Size of volume in GB", + "title": "Size of volume in GiB", "type": "integer" }, "type": {