Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add methods for Idempotence Identifiers API #204

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added witness configuration to recovery plan spec.
- Added support for creating, deleting, and listing idempotence identifiers.

### Changed
- Updated the v3 Cluster spec and status structs to match latest swagger spec
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ generate-v3-models: ## Generate V3 models using go-swagger
--model=recovery_plan_list_intent_response \
--model=recovery_plan_intent_resource \
--model=recovery_plan_list_metadata_output \
--model=sort_order
--model=sort_order \
--model=idempotence_identifiers_input \
--model=idempotence_identifiers_metadata \
--model=idempotence_identifiers_response \
--model=idempotence_identifiers_status

clean: ## Remove build related file
rm -fr ./bin vendor hack/tools/bin
Expand Down
46 changes: 46 additions & 0 deletions v3/mocks/TestOperations_CreateIdempotenceIdentifers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: api.keploy.io/v1beta2
kind: Http
name: TestOperations_CreateIdempotenceIdentifers
spec:
metadata:
name: Http
operation: POST
type: HTTP_CLIENT
req:
method: POST
proto_major: 1
proto_minor: 1
url: https://prism-test.nutanix.com:9440/api/nutanix/v3/idempotence_identifiers
header:
Accept: application/json
Content-Type: application/json
User-Agent: nutanix/v3
body: |
{"client_identifier":"testclient","count":2,"valid_duration_in_minutes":10}
body_type: utf-8
resp:
status_code: 200
header:
Content-Security-Policy: 'default-src ''self'' https://*.nutanix.com; script-src ''self'' ''unsafe-inline'' ''unsafe-eval''; style-src ''self'' ''unsafe-inline''; connect-src ''self'' wss: https://downloads.frame.nutanix.com https://downloads.frame.nutanix.us; img-src ''self'' blob: data:; frame-src ''self'' https://*.nutanix.com blob: data:'
Content-Type: application/json
Date: Tue, 10 Dec 2024 16:52:24 GMT
Server: envoy
Strict-Transport-Security: max-age=8640000:includeSubdomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Dns-Prefetch-Control: "off"
X-Envoy-Upstream-Service-Time: "274"
X-Frame-Options: SAMEORIGIN
X-Ntnx-Env: pc
X-Ntnx-Product: pc.2024.1.0.1
X-Permitted-Cross-Domain-Policies: master-only
X-Xss-Protection: 1; mode=block
body: |
{"client_identifier": "testclient", "count": 2, "expiration_time": "2024-12-10T17:01:02Z", "uuid_list": ["ab411b1a-f173-4009-9a8f-3d6e996c752a", "2515c166-dc95-4c12-8eb2-5d0aed9ad931"]}
body_type: utf-8
status_message: ""
proto_major: 0
proto_minor: 0
objects:
- type: error
data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA=
45 changes: 45 additions & 0 deletions v3/mocks/TestOperations_DeleteIdempotenceIdentifers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: api.keploy.io/v1beta2
kind: Http
name: TestOperations_DeleteIdempotenceIdentifers
spec:
metadata:
name: Http
operation: DELETE
type: HTTP_CLIENT
req:
method: DELETE
proto_major: 1
proto_minor: 1
url: https://prism-test.nutanix.com:9440/api/nutanix/v3/idempotence_identifiers/testclient
header:
Accept: application/json
Content-Type: application/json
User-Agent: nutanix/v3
body: ""
body_type: utf-8
resp:
status_code: 200
header:
Content-Length: "5"
Content-Security-Policy: 'default-src ''self'' https://*.nutanix.com; script-src ''self'' ''unsafe-inline'' ''unsafe-eval''; style-src ''self'' ''unsafe-inline''; connect-src ''self'' wss: https://downloads.frame.nutanix.com https://downloads.frame.nutanix.us; img-src ''self'' blob: data:; frame-src ''self'' https://*.nutanix.com blob: data:'
Content-Type: application/json
Date: Tue, 10 Dec 2024 16:53:51 GMT
Server: envoy
Strict-Transport-Security: max-age=8640000:includeSubdomains
X-Content-Type-Options: nosniff
X-Dns-Prefetch-Control: "off"
X-Envoy-Upstream-Service-Time: "191"
X-Frame-Options: SAMEORIGIN
X-Ntnx-Env: pc
X-Ntnx-Product: pc.2024.1.0.1
X-Permitted-Cross-Domain-Policies: master-only
X-Xss-Protection: 1; mode=block
body: |
null
body_type: utf-8
status_message: ""
proto_major: 0
proto_minor: 0
objects:
- type: error
data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA=
45 changes: 45 additions & 0 deletions v3/mocks/TestOperations_GetIdempotenceIdentifers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: api.keploy.io/v1beta2
kind: Http
name: TestOperations_GetIdempotenceIdentifers
spec:
metadata:
name: Http
operation: GET
type: HTTP_CLIENT
req:
method: GET
proto_major: 1
proto_minor: 1
url: https://prism-test.nutanix.com:9440/api/nutanix/v3/idempotence_identifiers/testclient
header:
Accept: application/json
Content-Type: application/json
User-Agent: nutanix/v3
body: ""
body_type: utf-8
resp:
status_code: 200
header:
Content-Security-Policy: 'default-src ''self'' https://*.nutanix.com; script-src ''self'' ''unsafe-inline'' ''unsafe-eval''; style-src ''self'' ''unsafe-inline''; connect-src ''self'' wss: https://downloads.frame.nutanix.com https://downloads.frame.nutanix.us; img-src ''self'' blob: data:; frame-src ''self'' https://*.nutanix.com blob: data:'
Content-Type: application/json
Date: Tue, 10 Dec 2024 16:52:31 GMT
Server: envoy
Strict-Transport-Security: max-age=8640000:includeSubdomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Dns-Prefetch-Control: "off"
X-Envoy-Upstream-Service-Time: "181"
X-Frame-Options: SAMEORIGIN
X-Ntnx-Env: pc
X-Ntnx-Product: pc.2024.1.0.1
X-Permitted-Cross-Domain-Policies: master-only
X-Xss-Protection: 1; mode=block
body: |
{"client_identifier": "testclient", "count": 2, "expiration_time": "2024-12-10T17:01:02Z", "uuid_list": ["ab411b1a-f173-4009-9a8f-3d6e996c752a", "2515c166-dc95-4c12-8eb2-5d0aed9ad931"]}
body_type: utf-8
status_message: ""
proto_major: 0
proto_minor: 0
objects:
- type: error
data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA=
111 changes: 111 additions & 0 deletions v3/models/idempotence_identifiers_input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading