diff --git a/Pipfile b/Pipfile index 717bb38..93c3f02 100644 --- a/Pipfile +++ b/Pipfile @@ -10,3 +10,4 @@ neon-client = {file = ".", editable = true} pytest = "*" pytest-recording = "*" pytest-ordering = "*" +ruff = "*" diff --git a/tests/cassettes/test_integration/test_api_keys.yaml b/tests/cassettes/test_integration/test_api_keys.yaml index 9949c8c..e3a4e4b 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-3250"}' + body: '{"key_name": "pytest-7165"}' headers: Accept: - application/json @@ -18,7 +18,7 @@ interactions: uri: https://console.neon.tech/api/v2/api_keys response: body: - string: '{"id":774518,"key":"6v5eet41f506cs580ux7alreysh6kmg5ww4vbs2glpivzouojx8dy7xiy7r33skp","name":"pytest-3250","created_at":"2024-01-25T14:27:03Z"}' + string: '{"id":774735,"key":"cr1h99xaf219r2b1x48f0ezxcz1fm3ypx5zgqzrktvszf324bysgj0k3co0xrpji","name":"pytest-7165","created_at":"2024-01-25T15:57:46Z"}' headers: Connection: - keep-alive @@ -27,13 +27,13 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:03 GMT + - Thu, 25 Jan 2024 15:57:46 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 4ecb3c3d7a1e0e1159d86f1edf6998a0 + - 8dcbf028f5370c2852df1c5d8ddf75af status: code: 200 message: OK @@ -54,7 +54,7 @@ interactions: uri: https://console.neon.tech/api/v2/api_keys response: body: - 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"}]' + string: '[{"id":774735,"name":"pytest-7165","created_at":"2024-01-25T15:57:46Z","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-25T15:57:46Z","last_used_from_addr":"204.111.161.156"}]' headers: Connection: - keep-alive @@ -63,13 +63,13 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:03 GMT + - Thu, 25 Jan 2024 15:57:46 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 5dbdfe85862caed42a9987300f9f3eeb + - a85a39be9e094e4e20523b5b5e00f2c4 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/774518 + uri: https://console.neon.tech/api/v2/api_keys/774735 response: body: - string: '{"id":774518,"name":"pytest-3250","revoked":true,"last_used_at":null,"last_used_from_addr":""}' + string: '{"id":774735,"name":"pytest-7165","revoked":true,"last_used_at":null,"last_used_from_addr":""}' headers: Connection: - keep-alive @@ -101,13 +101,13 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:03 GMT + - Thu, 25 Jan 2024 15:57:46 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - d372a070f6dcf9a61eacb0ae7bc8b302 + - 61b66794bc2ac60a5f8b19b054e5e9fa status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_branches.yaml b/tests/cassettes/test_integration/test_branches.yaml index cc1b07d..2522348 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: - - Thu, 25 Jan 2024 14:27:04 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - cc041c98d6f09132e2d60a9cb526e64a + - 42a3b9beeb8a82efba0a5d9a4e5a9b2a status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-8670"}}' + body: '{"project": {"name": "pytest-975"}}' headers: Accept: - application/json @@ -45,7 +45,7 @@ interactions: Connection: - keep-alive Content-Length: - - '36' + - '35' Content-Type: - application/json User-Agent: @@ -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":"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"}]}' + 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-hall-60879203","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-975","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","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:lOzq2QVs7rLu@ep-misty-truth-a5favp6j.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"lOzq2QVs7rLu","role":"kennethreitz","host":"ep-misty-truth-a5favp6j.us-east-2.aws.neon.tech","pooler_host":"ep-misty-truth-a5favp6j-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-square-dawn-a5kwozbg","name":"kennethreitz","password":"lOzq2QVs7rLu","protected":false,"created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}],"databases":[{"id":32656137,"branch_id":"br-square-dawn-a5kwozbg","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}],"operations":[{"id":"6ca36bc4-9abb-4f8b-92d5-599a42860f56","project_id":"silent-hall-60879203","branch_id":"br-square-dawn-a5kwozbg","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","total_duration_ms":0},{"id":"6a6bcfb8-59c9-499b-bef0-8d1e2e1d90ca","project_id":"silent-hall-60879203","branch_id":"br-square-dawn-a5kwozbg","endpoint_id":"ep-misty-truth-a5favp6j","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","total_duration_ms":0}],"branch":{"id":"br-square-dawn-a5kwozbg","project_id":"silent-hall-60879203","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"},"endpoints":[{"host":"ep-misty-truth-a5favp6j.us-east-2.aws.neon.tech","id":"ep-misty-truth-a5favp6j","project_id":"silent-hall-60879203","branch_id":"br-square-dawn-a5kwozbg","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","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:04 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -69,7 +69,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 6dee0ca266cc5051e0e11f281b70c442 + - 822f090413b84a64145045ce2bc92001 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/plain-cake-88652586/branches + uri: https://console.neon.tech/api/v2/projects/silent-hall-60879203/branches response: body: - 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"}]}' + string: '{"branches":[{"id":"br-square-dawn-a5kwozbg","project_id":"silent-hall-60879203","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}]}' headers: Connection: - keep-alive Content-Length: - - '374' + - '372' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - a53b13930019cf9fc7200ca637b9df22 + - 0d0998d802b4d2a36bbfc67f52897734 status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_database.yaml b/tests/cassettes/test_integration/test_database.yaml index 36543e4..b63fe4f 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":"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"}}' + string: '{"projects":[{"id":"silent-hall-60879203","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-975","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"silent-hall-60879203"}}' headers: Connection: - keep-alive Content-Length: - - '799' + - '800' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 5fa19c815172f3ac8278e1d361b57a67 + - 1a8e935964dd8c8a93708b6ff597f5bc status: code: 200 message: OK @@ -51,10 +51,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/projects/plain-cake-88652586 + uri: https://console.neon.tech/api/v2/projects/silent-hall-60879203 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":"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"}}' + 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-hall-60879203","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-975","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","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 @@ -63,18 +63,18 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 1029ee907756fd80ed07c75898dd8573 + - 923efbba77c71c27186969b1441da987 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-5633"}}' + body: '{"project": {"name": "pytest-3114"}}' 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":"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"}]}' + 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-cell-86624606","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3114","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","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:TaN2mFYSHn0p@ep-dark-block-a5kjtynt.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"TaN2mFYSHn0p","role":"kennethreitz","host":"ep-dark-block-a5kjtynt.us-east-2.aws.neon.tech","pooler_host":"ep-dark-block-a5kjtynt-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-aged-fog-a5tggcga","name":"kennethreitz","password":"TaN2mFYSHn0p","protected":false,"created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}],"databases":[{"id":32656138,"branch_id":"br-aged-fog-a5tggcga","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}],"operations":[{"id":"cec9a068-af54-4cc3-a40e-a5d842cd77ba","project_id":"silent-cell-86624606","branch_id":"br-aged-fog-a5tggcga","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","total_duration_ms":0},{"id":"8cfdb6f1-e6ef-4638-a9f3-acde30450d59","project_id":"silent-cell-86624606","branch_id":"br-aged-fog-a5tggcga","endpoint_id":"ep-dark-block-a5kjtynt","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","total_duration_ms":0}],"branch":{"id":"br-aged-fog-a5tggcga","project_id":"silent-cell-86624606","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"},"endpoints":[{"host":"ep-dark-block-a5kjtynt.us-east-2.aws.neon.tech","id":"ep-dark-block-a5kjtynt","project_id":"silent-cell-86624606","branch_id":"br-aged-fog-a5tggcga","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","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:05 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - eeade5e3220ae6cc18edb5b54cbd8f11 + - 4086da34bfc400b12f8982ff71a1e5b5 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/red-breeze-36806144/branches + uri: https://console.neon.tech/api/v2/projects/silent-cell-86624606/branches response: body: - 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"}]}' + string: '{"branches":[{"id":"br-aged-fog-a5tggcga","project_id":"silent-cell-86624606","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}]}' headers: Connection: - keep-alive Content-Length: - - '377' + - '369' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - afb856be0f23c62e1c941c80b355dec7 + - 251f32017b0c6bdd4348c3d0344f03f2 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/red-breeze-36806144/branches/br-sparkling-glitter-a5ykl4qi/databases + uri: https://console.neon.tech/api/v2/projects/silent-cell-86624606/branches/br-aged-fog-a5tggcga/databases response: body: - 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"}]}' + string: '{"databases":[{"id":32656138,"branch_id":"br-aged-fog-a5tggcga","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z"}]}' headers: Connection: - keep-alive Content-Length: - - '191' + - '182' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 124ec90a34465040fa7ca6ae0cf95dde + - ab37b6db12de0de9ca7ef99145a55594 status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_endpoints.yaml b/tests/cassettes/test_integration/test_endpoints.yaml index dd2c422..b64b4ec 100644 --- a/tests/cassettes/test_integration/test_endpoints.yaml +++ b/tests/cassettes/test_integration/test_endpoints.yaml @@ -16,22 +16,22 @@ interactions: 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"}}' + string: '{"projects":[{"id":"royal-rice-95423393","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1764","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-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"royal-rice-95423393"}}' headers: Connection: - keep-alive Content-Length: - - '809' + - '799' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:06 GMT + - Thu, 25 Jan 2024 15:57:50 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 6a70ec1f4a4f675f61d46f017667a53b + - 3505a358d2917b63921148869bde8cd7 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/wandering-paper-56638506 + uri: https://console.neon.tech/api/v2/projects/royal-rice-95423393 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"}}' + 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":"royal-rice-95423393","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1764","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-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","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' + - '966' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:06 GMT + - Thu, 25 Jan 2024 15:57:50 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - cab6b630fdc1ba0f97940ab685a7e35e + - 2ca0dd5b1c66944dcfcd667c0a8d5d88 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-2787"}}' + body: '{"project": {"name": "pytest-5133"}}' 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":"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"}]}' + 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":"dark-sun-46453911","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5133","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","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:6bA5GlQtyrMw@ep-shrill-boat-a5ez4tdt.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"6bA5GlQtyrMw","role":"kennethreitz","host":"ep-shrill-boat-a5ez4tdt.us-east-2.aws.neon.tech","pooler_host":"ep-shrill-boat-a5ez4tdt-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-withered-paper-a5o7qhfg","name":"kennethreitz","password":"6bA5GlQtyrMw","protected":false,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}],"databases":[{"id":32656141,"branch_id":"br-withered-paper-a5o7qhfg","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}],"operations":[{"id":"cbf9f4bc-7fd5-4b17-b4d3-e3974d4db233","project_id":"dark-sun-46453911","branch_id":"br-withered-paper-a5o7qhfg","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","total_duration_ms":0},{"id":"be6059a1-1d84-4414-96c3-1279cc851808","project_id":"dark-sun-46453911","branch_id":"br-withered-paper-a5o7qhfg","endpoint_id":"ep-shrill-boat-a5ez4tdt","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","total_duration_ms":0}],"branch":{"id":"br-withered-paper-a5o7qhfg","project_id":"dark-sun-46453911","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"},"endpoints":[{"host":"ep-shrill-boat-a5ez4tdt.us-east-2.aws.neon.tech","id":"ep-shrill-boat-a5ez4tdt","project_id":"dark-sun-46453911","branch_id":"br-withered-paper-a5o7qhfg","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","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 + - Thu, 25 Jan 2024 15:57:50 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 49ad2fb588d7162acc10efbafec90580 + - 7f965b9bba5a6b97135299ca71449a1d 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/bitter-river-43445931/branches + uri: https://console.neon.tech/api/v2/projects/dark-sun-46453911/endpoints 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"}]}' + string: '{"endpoints":[{"host":"ep-shrill-boat-a5ez4tdt.us-east-2.aws.neon.tech","id":"ep-shrill-boat-a5ez4tdt","project_id":"dark-sun-46453911","branch_id":"br-withered-paper-a5o7qhfg","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}]}' headers: Connection: - keep-alive Content-Length: - - '372' + - '679' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:07 GMT + - Thu, 25 Jan 2024 15:57:50 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 39272dacc3b1f66182d901c0ac781c62 + - a36f4a81deb7f72a0eead3fea34d1bc2 status: code: 200 message: OK @@ -161,61 +161,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/bitter-river-43445931/endpoints + uri: https://console.neon.tech/api/v2/projects/dark-sun-46453911/endpoints/ep-shrill-boat-a5ez4tdt 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"}]}' + string: '{"endpoint":{"host":"ep-shrill-boat-a5ez4tdt.us-east-2.aws.neon.tech","id":"ep-shrill-boat-a5ez4tdt","project_id":"dark-sun-46453911","branch_id":"br-withered-paper-a5o7qhfg","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","proxy_host":"us-east-2.aws.neon.tech","suspend_timeout_seconds":0,"provisioner":"k8s-neonvm"}}' headers: Connection: - keep-alive Content-Length: - - '673' + - '676' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:07 GMT + - Thu, 25 Jan 2024 15:57:50 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 + - 46eadfbf272f4456efe09cf1b7079d74 status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_me.yaml b/tests/cassettes/test_integration/test_me.yaml index 936c696..6c0c36e 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: - - Thu, 25 Jan 2024 14:27:03 GMT + - Thu, 25 Jan 2024 15:57:46 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 69ac9aefe8eda87cb6c3f80f8bc85dda + - f41044e300a8c83afa4b283e866b6281 status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_operations.yaml b/tests/cassettes/test_integration/test_operations.yaml index aa07499..63081d1 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":"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"}}' + string: '{"projects":[{"id":"silent-cell-86624606","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3114","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"silent-cell-86624606"}}' headers: Connection: - keep-alive Content-Length: - - '799' + - '801' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - a8d91c61e62f55bdfc2d35ee48093a2c + - 754ef66372fbc6b6b37c68030726ef00 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/red-breeze-36806144 + uri: https://console.neon.tech/api/v2/projects/silent-cell-86624606 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":"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"}}' + 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-cell-86624606","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3114","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-25T15:57:48Z","updated_at":"2024-01-25T15:57:48Z","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' + - '967' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:05 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - a24eb226aa245cf217c0bd35bbd60423 + - 9d1ddcdfe99fd2f6bbdf10f059781c52 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-1374"}}' + body: '{"project": {"name": "pytest-1764"}}' 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":"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"}]}' + 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":"royal-rice-95423393","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-1764","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-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","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:Iykfw9U2VKjc@ep-bold-sound-a5p8di10.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"Iykfw9U2VKjc","role":"kennethreitz","host":"ep-bold-sound-a5p8di10.us-east-2.aws.neon.tech","pooler_host":"ep-bold-sound-a5p8di10-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-green-unit-a5sehv93","name":"kennethreitz","password":"Iykfw9U2VKjc","protected":false,"created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z"}],"databases":[{"id":32656139,"branch_id":"br-green-unit-a5sehv93","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z"}],"operations":[{"id":"1a7a6e72-fa6c-44bb-9048-07b29a2475ee","project_id":"royal-rice-95423393","branch_id":"br-green-unit-a5sehv93","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","total_duration_ms":0},{"id":"c99b8635-079c-40ef-b243-c6b431c3cd5c","project_id":"royal-rice-95423393","branch_id":"br-green-unit-a5sehv93","endpoint_id":"ep-bold-sound-a5p8di10","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","total_duration_ms":0}],"branch":{"id":"br-green-unit-a5sehv93","project_id":"royal-rice-95423393","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-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z"},"endpoints":[{"host":"ep-bold-sound-a5p8di10.us-east-2.aws.neon.tech","id":"ep-bold-sound-a5p8di10","project_id":"royal-rice-95423393","branch_id":"br-green-unit-a5sehv93","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-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","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:06 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 15c34701b81ea7e0269356c2150d640d + - 5521ac673ec6c906dbee813953becf30 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/wandering-paper-56638506/branches + uri: https://console.neon.tech/api/v2/projects/royal-rice-95423393/branches response: body: - 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"}]}' + string: '{"branches":[{"id":"br-green-unit-a5sehv93","project_id":"royal-rice-95423393","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-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z"}]}' headers: Connection: - keep-alive Content-Length: - - '376' + - '370' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:06 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - daf8e082d02b4af713fa9a43040648cf + - a0b7251ef60d47007d8efed6cc604f67 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/wandering-paper-56638506/operations + uri: https://console.neon.tech/api/v2/projects/royal-rice-95423393/operations response: body: - 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"}}' + string: '{"operations":[{"id":"c99b8635-079c-40ef-b243-c6b431c3cd5c","project_id":"royal-rice-95423393","branch_id":"br-green-unit-a5sehv93","endpoint_id":"ep-bold-sound-a5p8di10","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","total_duration_ms":0},{"id":"1a7a6e72-fa6c-44bb-9048-07b29a2475ee","project_id":"royal-rice-95423393","branch_id":"br-green-unit-a5sehv93","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","total_duration_ms":17}],"pagination":{"cursor":"2024-01-25T15:57:49.545014Z"}}' headers: Connection: - keep-alive Content-Length: - - '675' + - '665' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:06 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 08bbc3d115e5af96cab664d1d16617eb + - 4b8b02106d16eb93f28dd8f68589541b status: code: 200 message: OK @@ -197,25 +197,25 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: GET - uri: https://console.neon.tech/api/v2/projects/wandering-paper-56638506/operations/6cb25044-5733-4daf-939b-5cfd2af72c52 + uri: https://console.neon.tech/api/v2/projects/royal-rice-95423393/operations/c99b8635-079c-40ef-b243-c6b431c3cd5c response: body: - 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}}' + string: '{"operation":{"id":"c99b8635-079c-40ef-b243-c6b431c3cd5c","project_id":"royal-rice-95423393","branch_id":"br-green-unit-a5sehv93","endpoint_id":"ep-bold-sound-a5p8di10","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:49Z","updated_at":"2024-01-25T15:57:49Z","total_duration_ms":0}}' headers: Connection: - keep-alive Content-Length: - - '334' + - '330' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:06 GMT + - Thu, 25 Jan 2024 15:57:49 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 1e893a7c4af656591c1a9752abfa817a + - 001d634b7e8baf1841a4c85dc50468ed status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_project.yaml b/tests/cassettes/test_integration/test_project.yaml index 6f744e0..4741033 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":"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"}}' + string: '{"projects":[{"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,"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":312,"cpu_used_sec":84,"creation_source":"console","created_at":"2024-01-25T14:27:07Z","updated_at":"2024-01-25T14:27:09Z","synthetic_storage_size":32658808,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"silent-pine-45061972"}}' headers: Connection: - keep-alive Content-Length: - - '805' + - '811' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:03 GMT + - Thu, 25 Jan 2024 15:57:47 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - ec3c281f10a0005edc742924e3776ae5 + - a5d4e69b0b4f61933d29dadb2e796beb 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/twilight-wood-73485599 + uri: https://console.neon.tech/api/v2/projects/silent-pine-45061972 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":"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"}}' + string: '{"project":{"data_storage_bytes_hour":65317616,"data_transfer_bytes":0,"written_data_bytes":32073176,"compute_time_seconds":84,"active_time_seconds":312,"cpu_used_sec":84,"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:09Z","synthetic_storage_size":32658808,"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: - - '969' + - '992' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:03 GMT + - Thu, 25 Jan 2024 15:57:47 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 42087c3c717aeee630fe8af3d177c13c + - 55730e33b2c3af9c57d58a08ca2c55a7 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-1692"}}' + body: '{"project": {"name": "pytest-8512"}}' 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":"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"}]}' + 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":"super-lab-49305559","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-8512","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-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z","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:ZoI8HOCzy2Fq@ep-winter-fog-a5o423he.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"ZoI8HOCzy2Fq","role":"kennethreitz","host":"ep-winter-fog-a5o423he.us-east-2.aws.neon.tech","pooler_host":"ep-winter-fog-a5o423he-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-sparkling-limit-a5jhvx7d","name":"kennethreitz","password":"ZoI8HOCzy2Fq","protected":false,"created_at":"2024-01-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z"}],"databases":[{"id":32656135,"branch_id":"br-sparkling-limit-a5jhvx7d","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z"}],"operations":[{"id":"eda64e91-c153-4298-b673-ef527bf283de","project_id":"super-lab-49305559","branch_id":"br-sparkling-limit-a5jhvx7d","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z","total_duration_ms":0},{"id":"b91c654b-fa13-48d5-95db-7527481de5de","project_id":"super-lab-49305559","branch_id":"br-sparkling-limit-a5jhvx7d","endpoint_id":"ep-winter-fog-a5o423he","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z","total_duration_ms":0}],"branch":{"id":"br-sparkling-limit-a5jhvx7d","project_id":"super-lab-49305559","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-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z"},"endpoints":[{"host":"ep-winter-fog-a5o423he.us-east-2.aws.neon.tech","id":"ep-winter-fog-a5o423he","project_id":"super-lab-49305559","branch_id":"br-sparkling-limit-a5jhvx7d","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-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z","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:03 GMT + - Thu, 25 Jan 2024 15:57:47 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 53ba94d5cb47b27c6995ea08047ad004 + - 410c2128ae97bf7d61ebde01ceea3793 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/soft-fire-82383337 + uri: https://console.neon.tech/api/v2/projects/super-lab-49305559 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":"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"}}}' + 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":"super-lab-49305559","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-8512","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-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z","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: - - Thu, 25 Jan 2024 14:27:04 GMT + - Thu, 25 Jan 2024 15:57:47 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - c6df442feb48c66f8e2f3ca3811888a8 + - 56cbdf88e090e62e31c8c6215d543e1c status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-5131"}}' + body: '{"project": {"name": "pytest-3457"}}' 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/soft-fire-82383337 + uri: https://console.neon.tech/api/v2/projects/super-lab-49305559 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":"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":[]}' + 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":"super-lab-49305559","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3457","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-25T15:57:47Z","updated_at":"2024-01-25T15:57: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"},"operations":[]}' headers: Connection: - keep-alive @@ -175,13 +175,13 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:04 GMT + - Thu, 25 Jan 2024 15:57:47 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - bbdfee6d3bee8c39306ad1fa1f85a576 + - d1d56bdad396884634f814b75264026a status: code: 200 message: OK @@ -202,7 +202,7 @@ interactions: uri: https://console.neon.tech/api/v2/projects response: body: - 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"}}' + string: '{"projects":[{"id":"super-lab-49305559","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3457","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-25T15:57:47Z","updated_at":"2024-01-25T15:57:47Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"super-lab-49305559"}}' headers: Connection: - keep-alive @@ -211,13 +211,49 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:04 GMT + - Thu, 25 Jan 2024 15:57:47 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 06a52f13856cbca7ce2dadc7edd0c4bc + - 862933986dbbe6776c7dda98c550f11b + 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/shared + response: + body: + string: '{"projects":[]}' + headers: + Connection: + - keep-alive + Content-Length: + - '15' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 15:57:47 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - be75936654fe234a16016f9514557189 status: code: 200 message: OK @@ -237,10 +273,10 @@ interactions: User-Agent: - neon-client/python version=(0.1.0) method: DELETE - uri: https://console.neon.tech/api/v2/projects/soft-fire-82383337 + uri: https://console.neon.tech/api/v2/projects/super-lab-49305559 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":"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"}}' + 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":"super-lab-49305559","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-3457","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-25T15:57:47Z","updated_at":"2024-01-25T15:57: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 @@ -249,13 +285,13 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:04 GMT + - Thu, 25 Jan 2024 15:57:48 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - b43988bfa57140342533f3d911ae126d + - 69b49cbf4608fd6738b3ec4fd185e16a status: code: 200 message: OK diff --git a/tests/cassettes/test_integration/test_roles.yaml b/tests/cassettes/test_integration/test_roles.yaml index 722fc14..7ad4934 100644 --- a/tests/cassettes/test_integration/test_roles.yaml +++ b/tests/cassettes/test_integration/test_roles.yaml @@ -16,22 +16,22 @@ interactions: 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"}}' + string: '{"projects":[{"id":"dark-sun-46453911","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5133","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","synthetic_storage_size":0,"quota_reset_at":"2024-02-01T00:00:00Z","owner_id":"838386f6-b5f1-4c3b-89a2-4f5a130ef3de"}],"pagination":{"cursor":"dark-sun-46453911"}}' headers: Connection: - keep-alive Content-Length: - - '803' + - '795' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:07 GMT + - Thu, 25 Jan 2024 15:57:50 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 70c9491f51de61184d5c1dcf4975e551 + - 17a475f309332dada5aab563f7fbe49c 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/bitter-river-43445931 + uri: https://console.neon.tech/api/v2/projects/dark-sun-46453911 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"}}' + 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":"dark-sun-46453911","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-5133","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","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' + - '964' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:07 GMT + - Thu, 25 Jan 2024 15:57:50 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - b8a532a55474f932254bb9488d37e665 + - ac7a75802dd2e7eb954e31bd1e97cd71 status: code: 200 message: OK - request: - body: '{"project": {"name": "pytest-1011"}}' + body: '{"project": {"name": "pytest-4620"}}' 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":"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"}]}' + 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":"bold-sun-73491519","platform_id":"aws","region_id":"aws-us-east-2","name":"pytest-4620","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","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:iPSUDyB83uWh@ep-patient-cake-a50xo01z.us-east-2.aws.neon.tech/neondb","connection_parameters":{"database":"neondb","password":"iPSUDyB83uWh","role":"kennethreitz","host":"ep-patient-cake-a50xo01z.us-east-2.aws.neon.tech","pooler_host":"ep-patient-cake-a50xo01z-pooler.us-east-2.aws.neon.tech"}}],"roles":[{"branch_id":"br-wild-queen-a5g61xzu","name":"kennethreitz","password":"iPSUDyB83uWh","protected":false,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}],"databases":[{"id":32656142,"branch_id":"br-wild-queen-a5g61xzu","name":"neondb","owner_name":"kennethreitz","created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}],"operations":[{"id":"ac2e1de8-2dcc-4650-996d-e35ff312a701","project_id":"bold-sun-73491519","branch_id":"br-wild-queen-a5g61xzu","action":"create_timeline","status":"running","failures_count":0,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","total_duration_ms":0},{"id":"e8ff1b85-d03d-4a2b-9b0f-82c27aec9324","project_id":"bold-sun-73491519","branch_id":"br-wild-queen-a5g61xzu","endpoint_id":"ep-patient-cake-a50xo01z","action":"start_compute","status":"scheduling","failures_count":0,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","total_duration_ms":0}],"branch":{"id":"br-wild-queen-a5g61xzu","project_id":"bold-sun-73491519","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"},"endpoints":[{"host":"ep-patient-cake-a50xo01z.us-east-2.aws.neon.tech","id":"ep-patient-cake-a50xo01z","project_id":"bold-sun-73491519","branch_id":"br-wild-queen-a5g61xzu","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z","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 + - Thu, 25 Jan 2024 15:57:51 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Transfer-Encoding: @@ -107,7 +107,7 @@ interactions: Vary: - Origin X-Neon-Ret-Request-Id: - - 34f947928c8db1575204efa8316fb6bd + - 874ba77273a94aa572a452fd744f4881 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/silent-pine-45061972/branches + uri: https://console.neon.tech/api/v2/projects/bold-sun-73491519/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"}]}' + string: '{"branches":[{"id":"br-wild-queen-a5g61xzu","project_id":"bold-sun-73491519","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-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}]}' headers: Connection: - keep-alive Content-Length: - - '374' + - '368' Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:08 GMT + - Thu, 25 Jan 2024 15:57:51 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - 249e29877a7f6eecae4552b52f083339 + - df7bc161bbe035eced3a7ccbaf3eb63a status: code: 200 message: OK @@ -161,46 +161,10 @@ interactions: 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 + uri: https://console.neon.tech/api/v2/projects/bold-sun-73491519/branches/br-wild-queen-a5g61xzu/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"}}' + string: '{"roles":[{"branch_id":"br-wild-queen-a5g61xzu","name":"kennethreitz","protected":false,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}]}' headers: Connection: - keep-alive @@ -209,13 +173,49 @@ interactions: Content-Type: - application/json Date: - - Thu, 25 Jan 2024 14:27:08 GMT + - Thu, 25 Jan 2024 15:57:51 GMT Strict-Transport-Security: - max-age=15724800; includeSubDomains Vary: - Origin X-Neon-Ret-Request-Id: - - f480d4265b620086635de197344002ff + - f60dc1866549311627e7fceb197ece0b + 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/bold-sun-73491519/branches/br-wild-queen-a5g61xzu/roles/kennethreitz + response: + body: + string: '{"role":{"branch_id":"br-wild-queen-a5g61xzu","name":"kennethreitz","protected":false,"created_at":"2024-01-25T15:57:50Z","updated_at":"2024-01-25T15:57:50Z"}}' + headers: + Connection: + - keep-alive + Content-Length: + - '159' + Content-Type: + - application/json + Date: + - Thu, 25 Jan 2024 15:57:51 GMT + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Vary: + - Origin + X-Neon-Ret-Request-Id: + - 707a61d91570a9eba40bcecbdec4356c status: code: 200 message: OK diff --git a/tests/test_integration.py b/tests/test_integration.py index 3b76947..1d8c0f6 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -46,10 +46,14 @@ def test_project(neon, ensure_no_projects, random_name): # Ensure that the names are different. assert project1.name != project2.name - # Ensure that the IDs are present. + # Test Projects, ensure each project has an id. for project in neon.projects().projects: assert hasattr(project, "id") + # Test Shared Projects, ensure each project has an id. + for project in neon.projects(shared=True).projects: + assert hasattr(project, "id") + # Delete the project. neon.project_delete(project.id) @@ -155,7 +159,6 @@ def test_endpoints(neon, ensure_no_projects, random_name): project = neon.project_create(project={"name": random_name()}).project assert project.id - # List endpoints. endpoints = neon.endpoints(project.id).endpoints assert len(endpoints)