diff --git a/neon_client/client.py b/neon_client/client.py index af9d412..c7788fe 100644 --- a/neon_client/client.py +++ b/neon_client/client.py @@ -309,76 +309,65 @@ class NeonAPI: ) @returns_model(schema.EndpointsResponse) - def endpoints(self, project_id: str, branch_id: str) -> t.Dict[str, t.Any]: + def endpoints(self, project_id: str) -> t.Dict[str, t.Any]: """Get a list of endpoints for a given branch.""" - return self.request( - "GET", f"projects/{ project_id }/branches/{ branch_id }/endpoints" - ) + return self.request("GET", f"projects/{ project_id }/endpoints") @returns_model(schema.EndpointResponse) - def endpoint( - self, project_id: str, branch_id: str, endpoint_id: str - ) -> t.Dict[str, t.Any]: + def endpoint(self, project_id: str, endpoint_id: str) -> t.Dict[str, t.Any]: """Get an endpoint for a given branch.""" return self.request( "GET", - f"projects/{ project_id }/branches/{ branch_id }/endpoints/{ endpoint_id }", + f"projects/{ project_id }/endpoints/{ endpoint_id }", ) @returns_model(schema.EndpointOperations) def endpoint_create( self, project_id: str, - branch_id: str, **json: dict, ) -> t.Dict[str, t.Any]: """Create a new endpoint. Accepts all keyword arguments for json body.""" - return self.request( - "POST", - f"projects/{ project_id }/branches/{ branch_id }/endpoints", - json=json, - ) + return self.request("POST", f"projects/{ project_id }/endpoints", json=json) @returns_model(schema.EndpointOperations) - def endpoint_delete( - self, project_id: str, branch_id: str, endpoint_id: str - ) -> t.Dict[str, t.Any]: + def endpoint_delete(self, project_id: str, endpoint_id: str) -> t.Dict[str, t.Any]: """Delete an endpoint by endpoint_id.""" return self.request( "DELETE", - f"projects/{ project_id }/branches/{ branch_id }/endpoints/{ endpoint_id }", + f"projects/{ project_id }/endpoints/{ endpoint_id }", ) @returns_model(schema.EndpointOperations) def endpoint_update( - self, project_id: str, branch_id: str, endpoint_id: str, **json: dict + self, project_id: str, endpoint_id: str, **json: dict ) -> t.Dict[str, t.Any]: """Update an endpoint. Accepts all keyword arguments for json body.""" return self.request( "PATCH", - f"projects/{ project_id }/branches/{ branch_id }/endpoints/{ endpoint_id }", + f"projects/{ project_id }/endpoints/{ endpoint_id }", json=json, ) @returns_model(schema.EndpointOperations) - def endpoint_start(self, project_id: str, branch_id: str, endpoint_id: str): + def endpoint_start(self, project_id: str, endpoint_id: str): """Start an endpoint by endpoint_id.""" return self.request( "POST", - f"projects/{ project_id }/branches/{ branch_id }/endpoints/{ endpoint_id }/start", + f"projects/{ project_id }/endpoints/{ endpoint_id }/start", ) @returns_model(schema.EndpointOperations) - def endpoint_suspend(self, project_id: str, branch_id: str, endpoint_id: str): + def endpoint_suspend(self, project_id: str, endpoint_id: str): """Suspend an endpoint by endpoint_id.""" return self.request( "POST", - f"projects/{ project_id }/branches/{ branch_id }/endpoints/{ endpoint_id }/suspend", + f"projects/{ project_id }/endpoints/{ endpoint_id }/suspend", ) @returns_model(schema.RolesResponse) diff --git a/tests/cassettes/test_integration/test_api_keys.yaml b/tests/cassettes/test_integration/test_api_keys.yaml index adc18a4..9949c8c 100644 --- a/tests/cassettes/test_integration/test_api_keys.yaml +++ b/tests/cassettes/test_integration/test_api_keys.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"key_name": "pytest-8877"}' + body: '{"key_name": "pytest-3250"}' headers: Accept: - application/json @@ -18,7 +18,7 @@ interactions: uri: https://console.neon.tech/api/v2/api_keys response: body: - string: '{"id":770959,"key":"sujk30fcgqn9bwtte51fspimwqweod88e50t1p40v0j13zj15tjkk99ywzbt1xoz","name":"pytest-8877","created_at":"2024-01-24T13:55:40Z"}' + string: '{"id":774518,"key":"6v5eet41f506cs580ux7alreysh6kmg5ww4vbs2glpivzouojx8dy7xiy7r33skp","name":"pytest-3250","created_at":"2024-01-25T14:27:03Z"}' headers: Connection: - keep-alive @@ -27,13 +27,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:40 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 5343674b346d4b860442487c77e04caa + - 4ecb3c3d7a1e0e1159d86f1edf6998a0 status: code: 200 message: OK @@ -54,7 +54,7 @@ interactions: uri: https://console.neon.tech/api/v2/api_keys response: body: - string: '[{"id":770959,"name":"pytest-8877","created_at":"2024-01-24T13:55:40Z","last_used_at":null,"last_used_from_addr":""},{"id":768620,"name":"neon_client","created_at":"2024-01-23T21:56:07Z","last_used_at":"2024-01-24T13:55:40Z","last_used_from_addr":"204.111.161.156"}]' + string: '[{"id":774518,"name":"pytest-3250","created_at":"2024-01-25T14:27:03Z","last_used_at":null,"last_used_from_addr":""},{"id":768620,"name":"neon_client","created_at":"2024-01-23T21:56:07Z","last_used_at":"2024-01-25T14:27:03Z","last_used_from_addr":"204.111.161.156"}]' headers: Connection: - keep-alive @@ -63,13 +63,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:40 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 7e8f348f84f42246076507dd411b7364 + - 5dbdfe85862caed42a9987300f9f3eeb status: code: 200 message: OK @@ -89,10 +89,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/api_keys/770959 + uri: https://console.neon.tech/api/v2/api_keys/774518 response: body: - string: '{"id":770959,"name":"pytest-8877","revoked":true,"last_used_at":null,"last_used_from_addr":""}' + string: '{"id":774518,"name":"pytest-3250","revoked":true,"last_used_at":null,"last_used_from_addr":""}' headers: Connection: - keep-alive @@ -101,13 +101,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:40 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - deaf54189dfd12fe26685391d6f9d609 + - d372a070f6dcf9a61eacb0ae7bc8b302 status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_branches.yaml b/tests/cassettes/test_integration/test_branches.yaml index 0378252..cc1b07d 100644 --- a/tests/cassettes/test_integration/test_branches.yaml +++ b/tests/cassettes/test_integration/test_branches.yaml @@ -25,18 +25,18 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:04 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 72384706de02e9a3f7b00af35937c5f3 + - cc041c98d6f09132e2d60a9cb526e64a status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-1124"}}' + body: '{"project": {"name": "pytest-8670"}}' headers: Accept: - application/json @@ -54,14 +54,14 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"cool-bird-75158673","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1124","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:pbKEAwCt4l3Q@ep-broad-shadow-a5zv1xko.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"pbKEAwCt4l3Q","role":"kennethreitz","host":"ep-broad-shadow-a5zv1xko.us-east-2.aws.neon.tech","pooler_host":"ep-broad-shadow-a5zv1xko-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-silent-sunset-a5za8cyv","name":"kennethreitz","password":"pbKEAwCt4l3Q","protected":false,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z"}],"databases":[{"id":32636971,"branch_id":"br-silent-sunset-a5za8cyv","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z"}],"operations":[{"id":"f1fc8c0f-d17c-4d24-9585-d8309def29d6","project_id":"cool-bird-75158673","branch_id":"br-silent-sunset-a5za8cyv","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z","total_duration_ms":0},{"id":"acc6ae0a-60cc-4fe6-8f50-f07b86b617fb","project_id":"cool-bird-75158673","branch_id":"br-silent-sunset-a5za8cyv","endpoint_id":"ep-broad-shadow-a5zv1xko","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z","total_duration_ms":0}],"branch":{"id":"br-silent-sunset-a5za8cyv","project_id":"cool-bird-75158673","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z"},"endpoints":[{"host":"ep-broad-shadow-a5zv1xko.us-east-2.aws.neon.tech","id":"ep-broad-shadow-a5zv1xko","project_id":"cool-bird-75158673","branch_id":"br-silent-sunset-a5za8cyv","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"plain-cake-88652586","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-8670","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:1S3RPKnvkezt@ep-twilight-butterfly-a5k1hwfw.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"1S3RPKnvkezt","role":"kennethreitz","host":"ep-twilight-butterfly-a5k1hwfw.us-east-2.aws.neon.tech","pooler_host":"ep-twilight-butterfly-a5k1hwfw-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-calm-snowflake-a5k01h0q","name":"kennethreitz","password":"1S3RPKnvkezt","protected":false,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z"}],"databases":[{"id":32655099,"branch_id":"br-calm-snowflake-a5k01h0q","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z"}],"operations":[{"id":"6202b1a4-52aa-40c1-9bdc-0b440f463fbb","project_id":"plain-cake-88652586","branch_id":"br-calm-snowflake-a5k01h0q","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z","total_duration_ms":0},{"id":"2b2dd923-954a-4341-8a84-58a576973b97","project_id":"plain-cake-88652586","branch_id":"br-calm-snowflake-a5k01h0q","endpoint_id":"ep-twilight-butterfly-a5k1hwfw","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z","total_duration_ms":0}],"branch":{"id":"br-calm-snowflake-a5k01h0q","project_id":"plain-cake-88652586","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z"},"endpoints":[{"host":"ep-twilight-butterfly-a5k1hwfw.us-east-2.aws.neon.tech","id":"ep-twilight-butterfly-a5k1hwfw","project_id":"plain-cake-88652586","branch_id":"br-calm-snowflake-a5k01h0q","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' headers: Connection: - keep-alive Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:04 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -69,7 +69,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 0cc52a86da1812674c6af69b58cc1ca3 + - 6dee0ca266cc5051e0e11f281b70c442 status: code: 201 message: Created @@ -87,25 +87,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/cool-bird-75158673/branches + uri: https://console.neon.tech/api/v2/projects/plain-cake-88652586/branches response: body: - string: '{"branches":[{"id":"br-silent-sunset-a5za8cyv","project_id":"cool-bird-75158673","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z"}]}' + string: '{"branches":[{"id":"br-calm-snowflake-a5k01h0q","project_id":"plain-cake-88652586","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z"}]}' headers: Connection: - keep-alive Content-Length: - - '372' + - '374' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 34bbb6a0319f2064f340a67115109e1e + - a53b13930019cf9fc7200ca637b9df22 status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_database.yaml b/tests/cassettes/test_integration/test_database.yaml index 7d5956d..36543e4 100644 --- a/tests/cassettes/test_integration/test_database.yaml +++ b/tests/cassettes/test_integration/test_database.yaml @@ -16,22 +16,22 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"projects":[{"id":"cool-bird-75158673","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1124","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"cool-bird-75158673"}}' + string: '{"projects":[{"id":"plain-cake-88652586","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-8670","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"plain-cake-88652586"}}' headers: Connection: - keep-alive Content-Length: - - '797' + - '799' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 9e5e07702eacff4d71123e78ce587e55 + - 5fa19c815172f3ac8278e1d361b57a67 status: code: 200 message: OK @@ -51,30 +51,30 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/projects/cool-bird-75158673 + uri: https://console.neon.tech/api/v2/projects/plain-cake-88652586 response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"cool-bird-75158673","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1124","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:41Z","updated_at":"2024-01-24T13:55:41Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"plain-cake-88652586","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-8670","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:04Z","updated_at":"2024-01-25T14:27:04Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' headers: Connection: - keep-alive Content-Length: - - '965' + - '966' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 2beb85d6b360051370d414661f56b6d8 + - 1029ee907756fd80ed07c75898dd8573 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-7669"}}' + body: '{"project": {"name": "pytest-5633"}}' headers: Accept: - application/json @@ -92,14 +92,14 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"orange-mouse-15162169","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-7669","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:g9oSHI5WCdBv@ep-spring-poetry-a5oz9ye3.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"g9oSHI5WCdBv","role":"kennethreitz","host":"ep-spring-poetry-a5oz9ye3.us-east-2.aws.neon.tech","pooler_host":"ep-spring-poetry-a5oz9ye3-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-morning-bar-a5x6ve4b","name":"kennethreitz","password":"g9oSHI5WCdBv","protected":false,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z"}],"databases":[{"id":32636972,"branch_id":"br-morning-bar-a5x6ve4b","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z"}],"operations":[{"id":"bd0121c1-84d1-487c-8424-02a69711e13f","project_id":"orange-mouse-15162169","branch_id":"br-morning-bar-a5x6ve4b","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z","total_duration_ms":0},{"id":"6faa7a1f-c150-4054-88c4-8765bf113c01","project_id":"orange-mouse-15162169","branch_id":"br-morning-bar-a5x6ve4b","endpoint_id":"ep-spring-poetry-a5oz9ye3","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z","total_duration_ms":0}],"branch":{"id":"br-morning-bar-a5x6ve4b","project_id":"orange-mouse-15162169","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z"},"endpoints":[{"host":"ep-spring-poetry-a5oz9ye3.us-east-2.aws.neon.tech","id":"ep-spring-poetry-a5oz9ye3","project_id":"orange-mouse-15162169","branch_id":"br-morning-bar-a5x6ve4b","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"red-breeze-36806144","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5633","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:Hi8EN4dtLvMC@ep-small-meadow-a51a2iuk.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"Hi8EN4dtLvMC","role":"kennethreitz","host":"ep-small-meadow-a51a2iuk.us-east-2.aws.neon.tech","pooler_host":"ep-small-meadow-a51a2iuk-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-sparkling-glitter-a5ykl4qi","name":"kennethreitz","password":"Hi8EN4dtLvMC","protected":false,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z"}],"databases":[{"id":32655100,"branch_id":"br-sparkling-glitter-a5ykl4qi","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z"}],"operations":[{"id":"f2e9086c-1170-4fcf-9524-e77b130db77e","project_id":"red-breeze-36806144","branch_id":"br-sparkling-glitter-a5ykl4qi","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z","total_duration_ms":0},{"id":"4f5f9f5b-0e9d-4c98-bb6d-696dd13c2be7","project_id":"red-breeze-36806144","branch_id":"br-sparkling-glitter-a5ykl4qi","endpoint_id":"ep-small-meadow-a51a2iuk","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z","total_duration_ms":0}],"branch":{"id":"br-sparkling-glitter-a5ykl4qi","project_id":"red-breeze-36806144","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z"},"endpoints":[{"host":"ep-small-meadow-a51a2iuk.us-east-2.aws.neon.tech","id":"ep-small-meadow-a51a2iuk","project_id":"red-breeze-36806144","branch_id":"br-sparkling-glitter-a5ykl4qi","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' headers: Connection: - keep-alive Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 02d485ba2e4af8c8bac3632a08c392ea + - eeade5e3220ae6cc18edb5b54cbd8f11 status: code: 201 message: Created @@ -125,25 +125,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/orange-mouse-15162169/branches + uri: https://console.neon.tech/api/v2/projects/red-breeze-36806144/branches response: body: - string: '{"branches":[{"id":"br-morning-bar-a5x6ve4b","project_id":"orange-mouse-15162169","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z"}]}' + string: '{"branches":[{"id":"br-sparkling-glitter-a5ykl4qi","project_id":"red-breeze-36806144","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z"}]}' headers: Connection: - keep-alive Content-Length: - - '373' + - '377' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 49ce39814f6f2441741050fa8bed3dc4 + - afb856be0f23c62e1c941c80b355dec7 status: code: 200 message: OK @@ -161,25 +161,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/orange-mouse-15162169/branches/br-morning-bar-a5x6ve4b/databases + uri: https://console.neon.tech/api/v2/projects/red-breeze-36806144/branches/br-sparkling-glitter-a5ykl4qi/databases response: body: - string: '{"databases":[{"id":32636972,"branch_id":"br-morning-bar-a5x6ve4b","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z"}]}' + string: '{"databases":[{"id":32655100,"branch_id":"br-sparkling-glitter-a5ykl4qi","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z"}]}' headers: Connection: - keep-alive Content-Length: - - '185' + - '191' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 539aac6dd764d02f6711b9dfccc949dd + - 124ec90a34465040fa7ca6ae0cf95dde status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_endpoints.yaml b/tests/cassettes/test_integration/test_endpoints.yaml new file mode 100644 index 0000000..dd2c422 --- /dev/null +++ b/tests/cassettes/test_integration/test_endpoints.yaml @@ -0,0 +1,222 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects + response: + body: + string: '{"projects":[{"id":"wandering-paper-56638506","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1374","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"wandering-paper-56638506"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '809' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:06 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 6a70ec1f4a4f675f61d46f017667a53b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: DELETE + uri: https://console.neon.tech/api/v2/projects/wandering-paper-56638506 + response: + body: + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"wandering-paper-56638506","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1374","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '971' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:06 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - cab6b630fdc1ba0f97940ab685a7e35e + status: + code: 200 + message: OK +- request: + body: '{"project": {"name": "pytest-2787"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: POST + uri: https://console.neon.tech/api/v2/projects + response: + body: + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"bitter-river-43445931","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2787","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:7DhTOBwgc5kq@ep-odd-star-a5vzwewa.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"7DhTOBwgc5kq","role":"kennethreitz","host":"ep-odd-star-a5vzwewa.us-east-2.aws.neon.tech","pooler_host":"ep-odd-star-a5vzwewa-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-dark-bread-a5h5gnnq","name":"kennethreitz","password":"7DhTOBwgc5kq","protected":false,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"}],"databases":[{"id":32655102,"branch_id":"br-dark-bread-a5h5gnnq","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"}],"operations":[{"id":"b6705366-a654-425b-8d4c-30a906415a3c","project_id":"bitter-river-43445931","branch_id":"br-dark-bread-a5h5gnnq","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":0},{"id":"e43750b3-f533-4ab9-a057-6cfc4474027e","project_id":"bitter-river-43445931","branch_id":"br-dark-bread-a5h5gnnq","endpoint_id":"ep-odd-star-a5vzwewa","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":0}],"branch":{"id":"br-dark-bread-a5h5gnnq","project_id":"bitter-river-43445931","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"},"endpoints":[{"host":"ep-odd-star-a5vzwewa.us-east-2.aws.neon.tech","id":"ep-odd-star-a5vzwewa","project_id":"bitter-river-43445931","branch_id":"br-dark-bread-a5h5gnnq","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 49ad2fb588d7162acc10efbafec90580 + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects/bitter-river-43445931/branches + response: + body: + string: '{"branches":[{"id":"br-dark-bread-a5h5gnnq","project_id":"bitter-river-43445931","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"}]}' + headers: + Connection: + - keep-alive + Content-Length: + - '372' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 39272dacc3b1f66182d901c0ac781c62 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects/bitter-river-43445931/endpoints + response: + body: + string: '{"endpoints":[{"host":"ep-odd-star-a5vzwewa.us-east-2.aws.neon.tech","id":"ep-odd-star-a5vzwewa","project_id":"bitter-river-43445931","branch_id":"br-dark-bread-a5h5gnnq","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"last_active":"2000-01-01T00:00:00Z","creation_source":"console","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + headers: + Connection: + - keep-alive + Content-Length: + - '673' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 810e27921ff7103407677df207776bb6 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects/bitter-river-43445931/endpoints/ep-odd-star-a5vzwewa + response: + body: + string: '{"endpoint":{"host":"ep-odd-star-a5vzwewa.us-east-2.aws.neon.tech","id":"ep-odd-star-a5vzwewa","project_id":"bitter-river-43445931","branch_id":"br-dark-bread-a5h5gnnq","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"last_active":"2000-01-01T00:00:00Z","creation_source":"console","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '670' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 32b7a3af7f9a53905ca842a0393d15ca + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_integration/test_me.yaml b/tests/cassettes/test_integration/test_me.yaml index 3fdc532..936c696 100644 --- a/tests/cassettes/test_integration/test_me.yaml +++ b/tests/cassettes/test_integration/test_me.yaml @@ -27,13 +27,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:40 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - d73a287b5650dadbd19664b6fd619780 + - 69ac9aefe8eda87cb6c3f80f8bc85dda status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_operations.yaml b/tests/cassettes/test_integration/test_operations.yaml index a950463..aa07499 100644 --- a/tests/cassettes/test_integration/test_operations.yaml +++ b/tests/cassettes/test_integration/test_operations.yaml @@ -16,22 +16,22 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"projects":[{"id":"orange-mouse-15162169","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-7669","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"orange-mouse-15162169"}}' + string: '{"projects":[{"id":"red-breeze-36806144","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5633","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"red-breeze-36806144"}}' headers: Connection: - keep-alive Content-Length: - - '803' + - '799' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 334d17e596aae5ab273594e82a5b1ae4 + - a8d91c61e62f55bdfc2d35ee48093a2c status: code: 200 message: OK @@ -51,30 +51,30 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/projects/orange-mouse-15162169 + uri: https://console.neon.tech/api/v2/projects/red-breeze-36806144 response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"orange-mouse-15162169","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-7669","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:42Z","updated_at":"2024-01-24T13:55:42Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"red-breeze-36806144","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5633","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:05Z","updated_at":"2024-01-25T14:27:05Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' headers: Connection: - keep-alive Content-Length: - - '968' + - '966' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:42 GMT + - Thu, 25 Jan 2024 14:27:05 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - af7781ef29fbef45307379f58fbcf90d + - a24eb226aa245cf217c0bd35bbd60423 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-1682"}}' + body: '{"project": {"name": "pytest-1374"}}' headers: Accept: - application/json @@ -92,14 +92,14 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"dry-sun-32303143","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1682","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:U4arIXlN8gdh@ep-restless-lab-a5monq62.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"U4arIXlN8gdh","role":"kennethreitz","host":"ep-restless-lab-a5monq62.us-east-2.aws.neon.tech","pooler_host":"ep-restless-lab-a5monq62-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-throbbing-block-a52mi9q5","name":"kennethreitz","password":"U4arIXlN8gdh","protected":false,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z"}],"databases":[{"id":32636973,"branch_id":"br-throbbing-block-a52mi9q5","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z"}],"operations":[{"id":"7b4bb4c0-cc21-4000-a2cd-aba6f37465bc","project_id":"dry-sun-32303143","branch_id":"br-throbbing-block-a52mi9q5","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","total_duration_ms":0},{"id":"73621f9a-3422-47c4-ab4d-b94fb2d5463e","project_id":"dry-sun-32303143","branch_id":"br-throbbing-block-a52mi9q5","endpoint_id":"ep-restless-lab-a5monq62","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","total_duration_ms":0}],"branch":{"id":"br-throbbing-block-a52mi9q5","project_id":"dry-sun-32303143","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z"},"endpoints":[{"host":"ep-restless-lab-a5monq62.us-east-2.aws.neon.tech","id":"ep-restless-lab-a5monq62","project_id":"dry-sun-32303143","branch_id":"br-throbbing-block-a52mi9q5","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"wandering-paper-56638506","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1374","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:2m4GRneicQfu@ep-late-sea-a5zqfbum.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"2m4GRneicQfu","role":"kennethreitz","host":"ep-late-sea-a5zqfbum.us-east-2.aws.neon.tech","pooler_host":"ep-late-sea-a5zqfbum-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-frosty-haze-a5i7xbva","name":"kennethreitz","password":"2m4GRneicQfu","protected":false,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"}],"databases":[{"id":32655101,"branch_id":"br-frosty-haze-a5i7xbva","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"}],"operations":[{"id":"699b679a-f13c-428e-b7f4-a1f7e7fc39ee","project_id":"wandering-paper-56638506","branch_id":"br-frosty-haze-a5i7xbva","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":0},{"id":"6cb25044-5733-4daf-939b-5cfd2af72c52","project_id":"wandering-paper-56638506","branch_id":"br-frosty-haze-a5i7xbva","endpoint_id":"ep-late-sea-a5zqfbum","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":0}],"branch":{"id":"br-frosty-haze-a5i7xbva","project_id":"wandering-paper-56638506","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"},"endpoints":[{"host":"ep-late-sea-a5zqfbum.us-east-2.aws.neon.tech","id":"ep-late-sea-a5zqfbum","project_id":"wandering-paper-56638506","branch_id":"br-frosty-haze-a5i7xbva","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' headers: Connection: - keep-alive Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:43 GMT + - Thu, 25 Jan 2024 14:27:06 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 5b28f365f3e4a1905d62ace02e54bc8d + - 15c34701b81ea7e0269356c2150d640d status: code: 201 message: Created @@ -125,25 +125,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/dry-sun-32303143/branches + uri: https://console.neon.tech/api/v2/projects/wandering-paper-56638506/branches response: body: - string: '{"branches":[{"id":"br-throbbing-block-a52mi9q5","project_id":"dry-sun-32303143","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z"}]}' + string: '{"branches":[{"id":"br-frosty-haze-a5i7xbva","project_id":"wandering-paper-56638506","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z"}]}' headers: Connection: - keep-alive Content-Length: - - '372' + - '376' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:43 GMT + - Thu, 25 Jan 2024 14:27:06 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 941f4e0580c0ad9cc77230b352229faa + - daf8e082d02b4af713fa9a43040648cf status: code: 200 message: OK @@ -161,25 +161,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/dry-sun-32303143/operations + uri: https://console.neon.tech/api/v2/projects/wandering-paper-56638506/operations response: body: - string: '{"operations":[{"id":"73621f9a-3422-47c4-ab4d-b94fb2d5463e","project_id":"dry-sun-32303143","branch_id":"br-throbbing-block-a52mi9q5","endpoint_id":"ep-restless-lab-a5monq62","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","total_duration_ms":0},{"id":"7b4bb4c0-cc21-4000-a2cd-aba6f37465bc","project_id":"dry-sun-32303143","branch_id":"br-throbbing-block-a52mi9q5","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","total_duration_ms":19}],"pagination":{"cursor":"2024-01-24T13:55:43.040646Z"}}' + string: '{"operations":[{"id":"6cb25044-5733-4daf-939b-5cfd2af72c52","project_id":"wandering-paper-56638506","branch_id":"br-frosty-haze-a5i7xbva","endpoint_id":"ep-late-sea-a5zqfbum","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":0},{"id":"699b679a-f13c-428e-b7f4-a1f7e7fc39ee","project_id":"wandering-paper-56638506","branch_id":"br-frosty-haze-a5i7xbva","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":19}],"pagination":{"cursor":"2024-01-25T14:27:06.154062Z"}}' headers: Connection: - keep-alive Content-Length: - - '671' + - '675' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:43 GMT + - Thu, 25 Jan 2024 14:27:06 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - f9077f132d1665c3c045afef70d862da + - 08bbc3d115e5af96cab664d1d16617eb status: code: 200 message: OK @@ -197,10 +197,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/dry-sun-32303143/operations/73621f9a-3422-47c4-ab4d-b94fb2d5463e + uri: https://console.neon.tech/api/v2/projects/wandering-paper-56638506/operations/6cb25044-5733-4daf-939b-5cfd2af72c52 response: body: - string: '{"operation":{"id":"73621f9a-3422-47c4-ab4d-b94fb2d5463e","project_id":"dry-sun-32303143","branch_id":"br-throbbing-block-a52mi9q5","endpoint_id":"ep-restless-lab-a5monq62","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-24T13:55:43Z","updated_at":"2024-01-24T13:55:43Z","total_duration_ms":0}}' + string: '{"operation":{"id":"6cb25044-5733-4daf-939b-5cfd2af72c52","project_id":"wandering-paper-56638506","branch_id":"br-frosty-haze-a5i7xbva","endpoint_id":"ep-late-sea-a5zqfbum","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","total_duration_ms":0}}' headers: Connection: - keep-alive @@ -209,13 +209,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:43 GMT + - Thu, 25 Jan 2024 14:27:06 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - f2499ce88636163dcc68c88be4051ca1 + - 1e893a7c4af656591c1a9752abfa817a status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_project.yaml b/tests/cassettes/test_integration/test_project.yaml index 2c07352..6f744e0 100644 --- a/tests/cassettes/test_integration/test_project.yaml +++ b/tests/cassettes/test_integration/test_project.yaml @@ -16,22 +16,22 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"projects":[{"id":"sweet-haze-98484788","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2613","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-24T13:55:29Z","updated_at":"2024-01-24T13:55:32Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"sweet-haze-98484788"}}' + string: '{"projects":[{"id":"twilight-wood-73485599","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3967","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-25T14:25:45Z","updated_at":"2024-01-25T14:25:47Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"twilight-wood-73485599"}}' headers: Connection: - keep-alive Content-Length: - - '799' + - '805' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:40 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 5f52745db752fe63d81b6fa30592bbf7 + - ec3c281f10a0005edc742924e3776ae5 status: code: 200 message: OK @@ -51,30 +51,30 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/projects/sweet-haze-98484788 + uri: https://console.neon.tech/api/v2/projects/twilight-wood-73485599 response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"sweet-haze-98484788","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2613","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:29Z","updated_at":"2024-01-24T13:55:32Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"twilight-wood-73485599","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3967","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:25:45Z","updated_at":"2024-01-25T14:25:47Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' headers: Connection: - keep-alive Content-Length: - - '966' + - '969' Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:40 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - e1c6a5c4ef7e369a08c1dd73b3e9ef23 + - 42087c3c717aeee630fe8af3d177c13c status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-4374"}}' + body: '{"project": {"name": "pytest-1692"}}' headers: Accept: - application/json @@ -92,14 +92,14 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"white-sea-87434266","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-4374","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:3fP0zFQDMBIw@ep-lively-sound-a5ju8ula.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"3fP0zFQDMBIw","role":"kennethreitz","host":"ep-lively-sound-a5ju8ula.us-east-2.aws.neon.tech","pooler_host":"ep-lively-sound-a5ju8ula-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-hidden-hill-a53agcv4","name":"kennethreitz","password":"3fP0zFQDMBIw","protected":false,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z"}],"databases":[{"id":32636970,"branch_id":"br-hidden-hill-a53agcv4","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z"}],"operations":[{"id":"1e288547-1fbe-4fa6-b759-c11da496214c","project_id":"white-sea-87434266","branch_id":"br-hidden-hill-a53agcv4","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z","total_duration_ms":0},{"id":"97b30201-c34e-49a3-a7d9-fcd51013595e","project_id":"white-sea-87434266","branch_id":"br-hidden-hill-a53agcv4","endpoint_id":"ep-lively-sound-a5ju8ula","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z","total_duration_ms":0}],"branch":{"id":"br-hidden-hill-a53agcv4","project_id":"white-sea-87434266","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z"},"endpoints":[{"host":"ep-lively-sound-a5ju8ula.us-east-2.aws.neon.tech","id":"ep-lively-sound-a5ju8ula","project_id":"white-sea-87434266","branch_id":"br-hidden-hill-a53agcv4","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"soft-fire-82383337","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1692","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:25aqmkTuNQhg@ep-summer-sun-a50g77sw.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"25aqmkTuNQhg","role":"kennethreitz","host":"ep-summer-sun-a50g77sw.us-east-2.aws.neon.tech","pooler_host":"ep-summer-sun-a50g77sw-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-damp-poetry-a5jqsri3","name":"kennethreitz","password":"25aqmkTuNQhg","protected":false,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z"}],"databases":[{"id":32655098,"branch_id":"br-damp-poetry-a5jqsri3","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z"}],"operations":[{"id":"9200d5e4-9375-4b39-abf5-47452f98b802","project_id":"soft-fire-82383337","branch_id":"br-damp-poetry-a5jqsri3","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z","total_duration_ms":0},{"id":"e749bcc5-0485-4557-8ebf-087e593debd1","project_id":"soft-fire-82383337","branch_id":"br-damp-poetry-a5jqsri3","endpoint_id":"ep-summer-sun-a50g77sw","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z","total_duration_ms":0}],"branch":{"id":"br-damp-poetry-a5jqsri3","project_id":"soft-fire-82383337","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z"},"endpoints":[{"host":"ep-summer-sun-a50g77sw.us-east-2.aws.neon.tech","id":"ep-summer-sun-a50g77sw","project_id":"soft-fire-82383337","branch_id":"br-damp-poetry-a5jqsri3","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' headers: Connection: - keep-alive Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:03 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 2dc7ab47633f1472b645f759c4b3b070 + - 53ba94d5cb47b27c6995ea08047ad004 status: code: 201 message: Created @@ -125,10 +125,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/white-sea-87434266 + uri: https://console.neon.tech/api/v2/projects/soft-fire-82383337 response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"white-sea-87434266","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-4374","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:40Z","synthetic_storage_size":0,"consumption_period_start":"2024-01-13T02:10:30Z","consumption_period_end":"2024-02-01T00:00:00Z","quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de","owner":{"email":"me@kennethreitz.org","branches_limit":10,"subscription_type":"free"}}}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"soft-fire-82383337","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1692","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:03Z","synthetic_storage_size":0,"consumption_period_start":"2024-01-13T02:10:30Z","consumption_period_end":"2024-02-01T00:00:00Z","quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de","owner":{"email":"me@kennethreitz.org","branches_limit":10,"subscription_type":"free"}}}' headers: Connection: - keep-alive @@ -137,18 +137,18 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:04 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 9e21226f04691fffb98122626fe07196 + - c6df442feb48c66f8e2f3ca3811888a8 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-2492"}}' + body: '{"project": {"name": "pytest-5131"}}' headers: Accept: - application/json @@ -163,10 +163,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: PATCH - uri: https://console.neon.tech/api/v2/projects/white-sea-87434266 + uri: https://console.neon.tech/api/v2/projects/soft-fire-82383337 response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"white-sea-87434266","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2492","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:41Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"operations":[]}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"soft-fire-82383337","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5131","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:04Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"operations":[]}' headers: Connection: - keep-alive @@ -175,13 +175,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:04 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - f1eb5bf99fc70e6dd4329b6c2b9fce03 + - bbdfee6d3bee8c39306ad1fa1f85a576 status: code: 200 message: OK @@ -202,7 +202,7 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - string: '{"projects":[{"id":"white-sea-87434266","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2492","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:41Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"white-sea-87434266"}}' + string: '{"projects":[{"id":"soft-fire-82383337","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5131","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:04Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"soft-fire-82383337"}}' headers: Connection: - keep-alive @@ -211,13 +211,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:04 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - c053cb0d9716657cafdb9f8dc4da5578 + - 06a52f13856cbca7ce2dadc7edd0c4bc status: code: 200 message: OK @@ -237,10 +237,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/projects/white-sea-87434266 + uri: https://console.neon.tech/api/v2/projects/soft-fire-82383337 response: body: - string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"white-sea-87434266","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2492","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-24T13:55:40Z","updated_at":"2024-01-24T13:55:41Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"soft-fire-82383337","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5131","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:03Z","updated_at":"2024-01-25T14:27:04Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' headers: Connection: - keep-alive @@ -249,13 +249,13 @@ interactions: Content-Type: - application/json Date: - - Wed, 24 Jan 2024 13:55:41 GMT + - Thu, 25 Jan 2024 14:27:04 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 6a9cbfb294599c762388953bcbc4769a + - b43988bfa57140342533f3d911ae126d status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_roles.yaml b/tests/cassettes/test_integration/test_roles.yaml new file mode 100644 index 0000000..722fc14 --- /dev/null +++ b/tests/cassettes/test_integration/test_roles.yaml @@ -0,0 +1,222 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects + response: + body: + string: '{"projects":[{"id":"bitter-river-43445931","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2787","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0,"autoscaling_limit_max_cu":0,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"active_time":0,"cpu_used_sec":0,"creation_source":"console","created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"bitter-river-43445931"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '803' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 70c9491f51de61184d5c1dcf4975e551 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: DELETE + uri: https://console.neon.tech/api/v2/projects/bitter-river-43445931 + response: + body: + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"bitter-river-43445931","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-2787","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:06Z","updated_at":"2024-01-25T14:27:06Z","synthetic_storage_size":0,"consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '968' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - b8a532a55474f932254bb9488d37e665 + status: + code: 200 + message: OK +- request: + body: '{"project": {"name": "pytest-1011"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: POST + uri: https://console.neon.tech/api/v2/projects + response: + body: + string: '{"project":{"data_storage_bytes_hour":0,"data_transfer_bytes":0,"written_data_bytes":0,"compute_time_seconds":0,"active_time_seconds":0,"cpu_used_sec":0,"id":"silent-pine-45061972","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1011","provisioner":"k8s-neonvm","default_endpoint_settings":{"autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"suspend_timeout_seconds":0},"settings":{"allowed_ips":{"ips":[],"primary_branch_only":false},"enable_logical_replication":false},"pg_version":15,"proxy_host":"us-east-2.aws.neon.tech","branch_logical_size_limit":3072,"branch_logical_size_limit_bytes":3221225472,"store_passwords":true,"creation_source":"console","history_retention_seconds":604800,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z","consumption_period_start":"0001-01-01T00:00:00Z","consumption_period_end":"0001-01-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"},"connection_uris":[{"connection_uri":"postgres://kennethreitz:GwQCd0k1jiDo@ep-steep-breeze-a5px4epa.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"GwQCd0k1jiDo","role":"kennethreitz","host":"ep-steep-breeze-a5px4epa.us-east-2.aws.neon.tech","pooler_host":"ep-steep-breeze-a5px4epa-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-old-waterfall-a5pq2m1t","name":"kennethreitz","password":"GwQCd0k1jiDo","protected":false,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z"}],"databases":[{"id":32655103,"branch_id":"br-old-waterfall-a5pq2m1t","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z"}],"operations":[{"id":"9f287035-eb3d-40a3-ae97-1c1ef96ce356","project_id":"silent-pine-45061972","branch_id":"br-old-waterfall-a5pq2m1t","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z","total_duration_ms":0},{"id":"42eb2355-4749-4bf0-89eb-998846f48721","project_id":"silent-pine-45061972","branch_id":"br-old-waterfall-a5pq2m1t","endpoint_id":"ep-steep-breeze-a5px4epa","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z","total_duration_ms":0}],"branch":{"id":"br-old-waterfall-a5pq2m1t","project_id":"silent-pine-45061972","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z"},"endpoints":[{"host":"ep-steep-breeze-a5px4epa.us-east-2.aws.neon.tech","id":"ep-steep-breeze-a5px4epa","project_id":"silent-pine-45061972","branch_id":"br-old-waterfall-a5pq2m1t","autoscaling_limit_min_cu":0.25,"autoscaling_limit_max_cu":0.25,"region_id":"aws-us-east-2","type":"read_write","current_state":"init","pending_state":"active","settings":{},"pooler_enabled":false,"pooler_mode":"transaction","disabled":false,"passwordless_access":true,"creation_source":"console","created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:07 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 34f947928c8db1575204efa8316fb6bd + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects/silent-pine-45061972/branches + response: + body: + string: '{"branches":[{"id":"br-old-waterfall-a5pq2m1t","project_id":"silent-pine-45061972","name":"main","current_state":"init","pending_state":"ready","creation_source":"console","primary":true,"cpu_used_sec":0,"compute_time_seconds":0,"active_time_seconds":0,"written_data_bytes":0,"data_transfer_bytes":0,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z"}]}' + headers: + Connection: + - keep-alive + Content-Length: + - '374' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:08 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 249e29877a7f6eecae4552b52f083339 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects/silent-pine-45061972/branches/br-old-waterfall-a5pq2m1t/roles + response: + body: + string: '{"roles":[{"branch_id":"br-old-waterfall-a5pq2m1t","name":"kennethreitz","protected":false,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z"}]}' + headers: + Connection: + - keep-alive + Content-Length: + - '165' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:08 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - ecba9e1da582e59f2a8f43eddea04b86 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - neon-client/python version=(0.1.0) + method: GET + uri: https://console.neon.tech/api/v2/projects/silent-pine-45061972/branches/br-old-waterfall-a5pq2m1t/roles/kennethreitz + response: + body: + string: '{"role":{"branch_id":"br-old-waterfall-a5pq2m1t","name":"kennethreitz","protected":false,"created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:07Z"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '162' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 14:27:08 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - f480d4265b620086635de197344002ff + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_integration.py b/tests/test_integration.py index 2e670aa..da870ee 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -133,6 +133,7 @@ def test_operations(neon, ensure_no_projects, random_name): project = neon.project_create(project={"name": random_name()}).project assert project.id + # Find the associated branch. branch = neon.branches(project.id).branches[0] # List operations. @@ -143,3 +144,44 @@ def test_operations(neon, ensure_no_projects, random_name): operation = operations[0] operation = neon.operation(project.id, operation.id).operation assert operation.id + + +@pytest.mark.vcr +def test_endpoints(neon, ensure_no_projects, random_name): + # Ensure there are no projects. + ensure_no_projects() + + # Create a project. + project = neon.project_create(project={"name": random_name()}).project + assert project.id + + # List endpoints. + endpoints = neon.endpoints(project.id).endpoints + assert len(endpoints) + + # Get the endpoint. + endpoint = endpoints[0] + endpoint = neon.endpoint(project.id, endpoint.id).endpoint + assert endpoint.id + + +@pytest.mark.vcr +def test_roles(neon, ensure_no_projects, random_name): + # Ensure there are no projects. + ensure_no_projects() + + # Create a project. + project = neon.project_create(project={"name": random_name()}).project + assert project.id + + # Find the associated branch. + branch = neon.branches(project.id).branches[0] + + # List roles. + roles = neon.roles(project.id, branch.id).roles + assert len(roles) + + # Get the role. + role = roles[0] + role = neon.role(project.id, branch.id, role.name).role + assert role.name