diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 86b0e83d..cb9d2541 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.21.0"
+ ".": "0.22.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index cd19e79d..0da4a381 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 633
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-9377b474dea790cb05261b341252967ecb7791d5aa9b102f2241a8b8826c11ab.yml
-openapi_spec_hash: c6a8c5e78604079deb242a0dd3d48cba
-config_hash: 814c5f622b6b26a5556a87031051c797
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-61246c736228a6c005ecc784c08b6339b9afff6b3ea7225ef6bad7112e158355.yml
+openapi_spec_hash: 2dfeaccd1623885572ec0f968f8f50c0
+config_hash: ed81680ad8f1babe06844ab73e7148d1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d53b3ef1..c3346843 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,35 @@
# Changelog
+## 0.22.0 (2025-11-25)
+
+Full Changelog: [v0.21.0...v0.22.0](https://github.com/G-Core/gcore-python/compare/v0.21.0...v0.22.0)
+
+### ⚠ BREAKING CHANGES
+
+* **cloud:** k8s references from k8 to k8s
+* **cloud:** updates to get/list LB l7 policy/rules models
+
+### Features
+
+* **api:** aggregated API specs update ([49ac2ae](https://github.com/G-Core/gcore-python/commit/49ac2ae5ff6575877adfc16d46454c1ddf9b4160))
+* **api:** aggregated API specs update ([299adc0](https://github.com/G-Core/gcore-python/commit/299adc06cba63fb89bd3cd5f17d10188db08c735))
+* **api:** aggregated API specs update ([fff1d1e](https://github.com/G-Core/gcore-python/commit/fff1d1e981d3c286288c77c0a9a7c3fa146abd80))
+* **cloud:** updates to get/list LB l7 policy/rules models ([95a4cf1](https://github.com/G-Core/gcore-python/commit/95a4cf12132dc638e3a0994e3b5a5249b079e5ad))
+
+
+### Bug Fixes
+
+* add overloads to L7 policy polling methods to match create/replace signatures ([ecd63d8](https://github.com/G-Core/gcore-python/commit/ecd63d8704925bb86d232ea97e90bf7b45bb6e0b))
+* add overloads to L7 policy polling methods to match create/replace signatures ([44d657e](https://github.com/G-Core/gcore-python/commit/44d657e515ffd4c65bdcd82a419f85db138ceeba))
+* **cloud:** add overloads to L7 policy polling methods ([a639930](https://github.com/G-Core/gcore-python/commit/a639930e1d18b1a95ba4dfff4b847efc9093f5ef))
+* **cloud:** k8s references from k8 to k8s ([96211ea](https://github.com/G-Core/gcore-python/commit/96211ea00c49baddd1ada6c26af994181bcd50de))
+* resolve type errors in L7 policy/rule polling methods ([30e648f](https://github.com/G-Core/gcore-python/commit/30e648f9d9a5f6ed0ad7bb9b34272819d85fb594))
+
+
+### Chores
+
+* **internal:** codegen related update ([a6fbaff](https://github.com/G-Core/gcore-python/commit/a6fbaffe05cbdd3dac367525266a736d6b633ec1))
+
## 0.21.0 (2025-11-17)
Full Changelog: [v0.20.0...v0.21.0](https://github.com/G-Core/gcore-python/compare/v0.20.0...v0.21.0)
diff --git a/api.md b/api.md
index 6158d8b8..5d4b590b 100644
--- a/api.md
+++ b/api.md
@@ -975,17 +975,17 @@ Methods:
- client.cloud.instances.metrics.list(instance_id, \*, project_id, region_id, \*\*params) -> MetricsList
-## K8s
+## K8S
Types:
```python
-from gcore.types.cloud import K8sClusterVersion, K8sClusterVersionList
+from gcore.types.cloud import K8SClusterVersion, K8SClusterVersionList
```
Methods:
-- client.cloud.k8s.list_versions(\*, project_id, region_id) -> K8sClusterVersionList
+- client.cloud.k8s.list_versions(\*, project_id, region_id) -> K8SClusterVersionList
### Flavors
@@ -999,10 +999,10 @@ Types:
```python
from gcore.types.cloud.k8s import (
- K8sCluster,
- K8sClusterCertificate,
- K8sClusterKubeconfig,
- K8sClusterList,
+ K8SCluster,
+ K8SClusterCertificate,
+ K8SClusterKubeconfig,
+ K8SClusterList,
)
```
@@ -1010,12 +1010,12 @@ Methods:
- client.cloud.k8s.clusters.create(\*, project_id, region_id, \*\*params) -> TaskIDList
- client.cloud.k8s.clusters.update(cluster_name, \*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.k8s.clusters.list(\*, project_id, region_id) -> K8sClusterList
+- client.cloud.k8s.clusters.list(\*, project_id, region_id) -> K8SClusterList
- client.cloud.k8s.clusters.delete(cluster_name, \*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.k8s.clusters.get(cluster_name, \*, project_id, region_id) -> K8sCluster
-- client.cloud.k8s.clusters.get_certificate(cluster_name, \*, project_id, region_id) -> K8sClusterCertificate
-- client.cloud.k8s.clusters.get_kubeconfig(cluster_name, \*, project_id, region_id) -> K8sClusterKubeconfig
-- client.cloud.k8s.clusters.list_versions_for_upgrade(cluster_name, \*, project_id, region_id) -> K8sClusterVersionList
+- client.cloud.k8s.clusters.get(cluster_name, \*, project_id, region_id) -> K8SCluster
+- client.cloud.k8s.clusters.get_certificate(cluster_name, \*, project_id, region_id) -> K8SClusterCertificate
+- client.cloud.k8s.clusters.get_kubeconfig(cluster_name, \*, project_id, region_id) -> K8SClusterKubeconfig
+- client.cloud.k8s.clusters.list_versions_for_upgrade(cluster_name, \*, project_id, region_id) -> K8SClusterVersionList
- client.cloud.k8s.clusters.upgrade(cluster_name, \*, project_id, region_id, \*\*params) -> TaskIDList
#### Nodes
@@ -1030,16 +1030,16 @@ Methods:
Types:
```python
-from gcore.types.cloud.k8s.clusters import K8sClusterPool, K8sClusterPoolList
+from gcore.types.cloud.k8s.clusters import K8SClusterPool, K8SClusterPoolList
```
Methods:
- client.cloud.k8s.clusters.pools.create(cluster_name, \*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.k8s.clusters.pools.update(pool_name, \*, project_id, region_id, cluster_name, \*\*params) -> K8sClusterPool
-- client.cloud.k8s.clusters.pools.list(cluster_name, \*, project_id, region_id) -> K8sClusterPoolList
+- client.cloud.k8s.clusters.pools.update(pool_name, \*, project_id, region_id, cluster_name, \*\*params) -> K8SClusterPool
+- client.cloud.k8s.clusters.pools.list(cluster_name, \*, project_id, region_id) -> K8SClusterPoolList
- client.cloud.k8s.clusters.pools.delete(pool_name, \*, project_id, region_id, cluster_name) -> TaskIDList
-- client.cloud.k8s.clusters.pools.get(pool_name, \*, project_id, region_id, cluster_name) -> K8sClusterPool
+- client.cloud.k8s.clusters.pools.get(pool_name, \*, project_id, region_id, cluster_name) -> K8SClusterPool
- client.cloud.k8s.clusters.pools.resize(pool_name, \*, project_id, region_id, cluster_name, \*\*params) -> TaskIDList
##### Nodes
diff --git a/examples/storage/README.md b/examples/storage/README.md
new file mode 100644
index 00000000..92ff06fe
--- /dev/null
+++ b/examples/storage/README.md
@@ -0,0 +1,254 @@
+# Gcore Storage SDK Examples
+
+This directory contains comprehensive examples demonstrating how to use the Gcore Storage SDK for Python. The examples cover both S3-compatible object storage and SFTP file transfer storage types.
+
+## Directory Structure
+
+The examples are organized into separate files, each with sync and async versions:
+
+```
+examples/storage/
+├── basic.py # Sync: Basic storage operations
+├── basic_async.py # Async: Basic storage operations
+├── s3_buckets.py # Sync: S3 bucket management
+├── s3_buckets_async.py # Async: S3 bucket management
+├── credentials.py # Sync: Credential management
+├── credentials_async.py # Async: Credential management
+└── README.md # This file
+```
+
+## Available Examples
+
+### 1. Basic Operations (`basic.py` / `basic_async.py`)
+
+Demonstrates fundamental storage operations:
+- Creating S3 and SFTP storage instances
+- Listing existing storages
+- Retrieving storage details
+- Updating storage configuration (expiration, server alias)
+- Deleting storage instances
+
+**Run the sync example:**
+```bash
+python examples/storage/basic.py
+```
+
+**Run the async example:**
+```bash
+python examples/storage/basic_async.py
+```
+
+**Key Features Demonstrated:**
+- Storage creation with different types and locations
+- Storage lifecycle management
+- Error handling
+- Proper credential display at creation time
+
+### 2. S3 Bucket Management (`s3_buckets.py` / `s3_buckets_async.py`)
+
+Comprehensive S3 bucket operations:
+- Creating S3 storage instances
+- Waiting for storage provisioning
+- Creating and managing S3 buckets
+- Setting bucket lifecycle policies
+- Configuring CORS (Cross-Origin Resource Sharing)
+- Managing bucket access policies
+- Deleting buckets and cleanup
+
+**Run the sync example:**
+```bash
+python examples/storage/s3_buckets.py
+```
+
+**Run the async example:**
+```bash
+python examples/storage/s3_buckets_async.py
+```
+
+**Key Features Demonstrated:**
+- Multiple bucket creation and management
+- Lifecycle policy configuration (object expiration)
+- CORS policy setup for web applications
+- Bucket access policy management (public/private access)
+- Proper resource cleanup
+
+### 3. Credentials Management (`credentials.py` / `credentials_async.py`)
+
+Advanced credential management operations:
+- S3 access key regeneration
+- SFTP password management (generate, set custom, remove)
+- Credential security best practices
+- Managing multiple storage types simultaneously
+
+**Run the sync example:**
+```bash
+python examples/storage/credentials.py
+```
+
+**Run the async example:**
+```bash
+python examples/storage/credentials_async.py
+```
+
+**Key Features Demonstrated:**
+- S3 access and secret key regeneration
+- SFTP password lifecycle management
+- Disabling/enabling password authentication
+- Handling multiple storages in a single example
+
+## Storage Types
+
+### S3-Compatible Storage
+
+Gcore's S3-compatible storage provides:
+- **Object Storage**: Store and retrieve files via S3 API
+- **Bucket Management**: Create, configure, and manage buckets
+- **Access Control**: Set bucket policies and CORS configurations
+- **Lifecycle Policies**: Automatic object expiration and cleanup
+- **API Compatibility**: Works with existing S3 SDKs and tools
+
+**Use Cases:**
+- Web application file storage
+- Backup and archival
+- Static website hosting
+- Content distribution
+
+### SFTP Storage
+
+Gcore's SFTP storage provides:
+- **File Transfer**: Standard SFTP protocol for file operations
+- **Authentication**: Password and SSH key-based authentication
+- **Directory Structure**: Traditional filesystem hierarchy
+- **Secure Transfer**: Encrypted file transfers
+
+**Use Cases:**
+- Legacy application integration
+- Secure file transfers
+- Automated backup systems
+- FTP replacement
+
+## Configuration
+
+The examples require a Gcore API key to authenticate. Set the `GCORE_API_KEY` environment variable before running any example:
+
+**Linux/macOS:**
+```bash
+export GCORE_API_KEY=your_api_key_here
+```
+
+**Windows (Command Prompt):**
+```cmd
+set GCORE_API_KEY=your_api_key_here
+```
+
+**Windows (PowerShell):**
+```powershell
+$env:GCORE_API_KEY="your_api_key_here"
+```
+
+Alternatively, you can create a `.env` file in the project root with:
+```
+GCORE_API_KEY=your_api_key_here
+```
+
+And load it before running examples (Linux/macOS):
+```bash
+export $(cat .env | xargs)
+```
+
+## Geographic Locations
+
+The examples use specific locations based on storage type:
+- **S3 storage**: "s-ed1" (Luxembourg) - supports S3-compatible object storage
+- **SFTP storage**: "ams" (Amsterdam) - supports SFTP file transfer
+
+You can change these to any available location that supports your desired storage type. To see available locations, use:
+
+```python
+from gcore import Gcore
+
+client = Gcore()
+locations = client.storage.locations.list()
+for location in locations:
+ print(f"{location.code}: {location.name}")
+```
+
+## Code Structure
+
+Each example follows a consistent pattern:
+
+- **Main Function**: Orchestrates the example flow by calling individual operation functions
+- **Operation Functions**: Each function handles a complete operation (create, list, update, delete, etc.)
+- **Keyword-Only Arguments**: All operation functions use keyword-only parameters for clarity
+- **Error Handling**: Appropriate error handling and user feedback
+- **Printed Output**: Clear section headers and descriptive output for each operation
+
+### Sync vs Async Examples
+
+The SDK provides both synchronous and asynchronous APIs:
+
+**Sync (`Gcore`):**
+- Uses `from gcore import Gcore`
+- Straightforward, blocking operations
+- Easier to understand and debug
+- Best for scripts and simple applications
+
+**Async (`AsyncGcore`):**
+- Uses `from gcore import AsyncGcore`
+- Non-blocking, concurrent operations
+- Requires `async`/`await` syntax
+- Best for high-performance applications
+- Main function uses `asyncio.run(main())`
+- Iteration uses `async for` instead of regular `for`
+
+## Troubleshooting
+
+### Common Issues
+
+1. **Storage Creation Failures**
+ - Check if location is valid and available
+ - Verify storage name is unique and follows naming rules (letters, numbers, dashes, underscores)
+ - Ensure API key has proper permissions
+
+2. **Bucket Operation Errors**
+ - Ensure storage is S3-compatible (not SFTP)
+ - Wait for storage to be fully provisioned before bucket operations (status should be "ok")
+ - Bucket names must be unique and follow S3 naming conventions
+
+3. **Authentication Issues**
+ - Verify GCORE_API_KEY environment variable is set
+ - Check that API key is valid and not expired
+ - Ensure API key has permissions for storage operations
+
+4. **Provisioning Timeouts**
+ - Storage provisioning can take time, especially for new accounts
+ - The examples include a 30-second wait with 2-second intervals
+ - If provisioning takes longer, increase max_wait in wait_for_storage_provisioning()
+
+### Getting Help
+
+- Check the [Gcore API Documentation](https://gcore.com/docs/api-reference/storage)
+- Review error messages for specific guidance
+- Ensure you're using the latest SDK version: `pip install --upgrade gcore`
+
+## Testing on Real Infrastructure
+
+All examples are designed to run on real Gcore infrastructure. They:
+- Create real resources (storages, buckets)
+- Perform actual API operations
+- Include cleanup functions to delete created resources
+- Handle errors gracefully to prevent resource leaks
+
+**Important**: Resources created by these examples will incur charges according to your Gcore pricing plan. Always ensure cleanup functions execute successfully to avoid unexpected costs.
+
+## Credentials Security
+
+- Credentials (S3 keys, SFTP passwords) are only visible at creation time and during regeneration operations
+- Never commit credentials to version control
+- Store credentials securely (e.g., environment variables, secret managers)
+- Rotate credentials regularly for security
+- Use SSH keys instead of passwords for SFTP when possible
+
+## Python Version
+
+These examples require Python 3.8 or higher, as specified by the SDK requirements.
diff --git a/examples/storage/basic.py b/examples/storage/basic.py
new file mode 100644
index 00000000..0f21b3c2
--- /dev/null
+++ b/examples/storage/basic.py
@@ -0,0 +1,76 @@
+import time
+
+from gcore import Gcore
+
+
+def main() -> None:
+ # TODO set API key before running
+ # api_key = os.environ["GCORE_API_KEY"]
+
+ gcore = Gcore(
+ # No need to explicitly pass to Gcore constructor if using environment variables
+ # api_key=api_key,
+ )
+
+ storage_id = create_storage(client=gcore)
+ list_storages(client=gcore)
+ get_storage(client=gcore, storage_id=storage_id)
+ update_storage(client=gcore, storage_id=storage_id)
+ delete_storage(client=gcore, storage_id=storage_id)
+
+
+def create_storage(*, client: Gcore) -> int:
+ print("\n=== CREATE STORAGE ===")
+ name = f"example-s3-storage-{int(time.time())}"
+ storage = client.storage.create(
+ name=name,
+ type="s3",
+ location="s-ed1",
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ print(f"S3 Access Key: {storage.credentials.s3.access_key}") # type: ignore[union-attr]
+ print(f"S3 Secret Key: {storage.credentials.s3.secret_key}") # type: ignore[union-attr]
+ print("======================")
+ return storage.id
+
+
+def list_storages(*, client: Gcore) -> None:
+ print("\n=== LIST STORAGES ===")
+ storages = client.storage.list()
+ for count, storage in enumerate(storages, 1):
+ print(
+ f" {count}. Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
+ )
+ print("=====================")
+
+
+def get_storage(*, client: Gcore, storage_id: int) -> None:
+ print("\n=== GET STORAGE ===")
+ storage = client.storage.get(storage_id=storage_id)
+ print(
+ f"Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
+ )
+ print(f"Address: {storage.address}, Created: {storage.created_at}, Can Restore: {storage.can_restore}")
+ print("===================")
+
+
+def update_storage(*, client: Gcore, storage_id: int) -> None:
+ print("\n=== UPDATE STORAGE ===")
+ storage = client.storage.update(
+ storage_id=storage_id,
+ expires="30 days",
+ )
+ print(f"Updated Storage: ID={storage.id}, Expires: {storage.expires}")
+ print("======================")
+
+
+def delete_storage(*, client: Gcore, storage_id: int) -> None:
+ print("\n=== DELETE STORAGE ===")
+ client.storage.delete(storage_id=storage_id)
+ print(f"Storage {storage_id} deleted successfully")
+ print("======================")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/storage/basic_async.py b/examples/storage/basic_async.py
new file mode 100644
index 00000000..fcbdf0ec
--- /dev/null
+++ b/examples/storage/basic_async.py
@@ -0,0 +1,79 @@
+import time
+import asyncio
+
+from gcore import AsyncGcore
+
+
+async def main() -> None:
+ # TODO set API key before running
+ # api_key = os.environ["GCORE_API_KEY"]
+
+ gcore = AsyncGcore(
+ # No need to explicitly pass to AsyncGcore constructor if using environment variables
+ # api_key=api_key,
+ )
+
+ storage_id = await create_storage(client=gcore)
+ await list_storages(client=gcore)
+ await get_storage(client=gcore, storage_id=storage_id)
+ await update_storage(client=gcore, storage_id=storage_id)
+ await delete_storage(client=gcore, storage_id=storage_id)
+
+
+async def create_storage(*, client: AsyncGcore) -> int:
+ print("\n=== CREATE STORAGE ===")
+ name = f"example-s3-storage-{int(time.time())}"
+ storage = await client.storage.create(
+ name=name,
+ type="s3",
+ location="s-ed1",
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ print(f"S3 Access Key: {storage.credentials.s3.access_key}") # type: ignore[union-attr]
+ print(f"S3 Secret Key: {storage.credentials.s3.secret_key}") # type: ignore[union-attr]
+ print("======================")
+ return storage.id
+
+
+async def list_storages(*, client: AsyncGcore) -> None:
+ print("\n=== LIST STORAGES ===")
+ storages = client.storage.list()
+ count = 1
+ async for storage in storages:
+ print(
+ f" {count}. Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
+ )
+ count += 1
+ print("=====================")
+
+
+async def get_storage(*, client: AsyncGcore, storage_id: int) -> None:
+ print("\n=== GET STORAGE ===")
+ storage = await client.storage.get(storage_id=storage_id)
+ print(
+ f"Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
+ )
+ print(f"Address: {storage.address}, Created: {storage.created_at}, Can Restore: {storage.can_restore}")
+ print("===================")
+
+
+async def update_storage(*, client: AsyncGcore, storage_id: int) -> None:
+ print("\n=== UPDATE STORAGE ===")
+ storage = await client.storage.update(
+ storage_id=storage_id,
+ expires="30 days",
+ )
+ print(f"Updated Storage: ID={storage.id}, Expires: {storage.expires}")
+ print("======================")
+
+
+async def delete_storage(*, client: AsyncGcore, storage_id: int) -> None:
+ print("\n=== DELETE STORAGE ===")
+ await client.storage.delete(storage_id=storage_id)
+ print(f"Storage {storage_id} deleted successfully")
+ print("======================")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/examples/storage/credentials.py b/examples/storage/credentials.py
new file mode 100644
index 00000000..9c40ede4
--- /dev/null
+++ b/examples/storage/credentials.py
@@ -0,0 +1,145 @@
+import time
+
+from gcore import Gcore
+
+
+def main() -> None:
+ # TODO set API key before running
+ # api_key = os.environ["GCORE_API_KEY"]
+
+ gcore = Gcore(
+ # No need to explicitly pass to Gcore constructor if using environment variables
+ # api_key=api_key,
+ )
+
+ # S3
+ s3_storage_id = create_s3_storage(client=gcore)
+ get_storage(client=gcore, storage_id=s3_storage_id)
+ generate_s3_keys(client=gcore, s3_storage_id=s3_storage_id)
+ delete_storage(client=gcore, storage_id=s3_storage_id)
+
+ # SFTP storage operations
+ sftp_storage_id = create_sftp_storage(client=gcore)
+ get_storage(client=gcore, storage_id=sftp_storage_id)
+ generate_sftp_password(client=gcore, sftp_storage_id=sftp_storage_id)
+ delete_sftp_password(client=gcore, sftp_storage_id=sftp_storage_id)
+ set_custom_sftp_password(client=gcore, sftp_storage_id=sftp_storage_id)
+ delete_storage(client=gcore, storage_id=sftp_storage_id)
+
+
+def create_s3_storage(*, client: Gcore) -> int:
+ print("\n=== CREATE S3 STORAGE ===")
+ s3_name = f"s3-creds-example-{int(time.time())}"
+ storage = client.storage.create(
+ name=s3_name,
+ type="s3",
+ location="s-ed1",
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ if storage.credentials and storage.credentials.s3:
+ print(f"S3 Access Key: {storage.credentials.s3.access_key}")
+ print(f"S3 Secret Key: {storage.credentials.s3.secret_key}")
+ print("=========================")
+ return storage.id
+
+
+def create_sftp_storage(*, client: Gcore) -> int:
+ print("\n=== CREATE SFTP STORAGE ===")
+ sftp_name = f"sftp-ex-{int(time.time()) % 1000000}"
+ storage = client.storage.create(
+ name=sftp_name,
+ type="sftp",
+ location="ams",
+ generate_sftp_password=True,
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ if storage.credentials and storage.credentials.sftp_password:
+ print(f"SFTP Password: {storage.credentials.sftp_password}")
+ print("==========================")
+ return storage.id
+
+
+def wait_for_storage_provisioning(
+ *, client: Gcore, storage_id: int, max_wait: int = 30, wait_interval: int = 2
+) -> None:
+ """Wait for a single storage to be provisioned"""
+ elapsed = 0
+ while elapsed < max_wait:
+ storage = client.storage.get(storage_id=storage_id)
+ if storage.provisioning_status == "ok":
+ print(f"Storage {storage_id} is ready")
+ return
+ print(f"Storage {storage_id} status: {storage.provisioning_status}, waiting...")
+ time.sleep(wait_interval)
+ elapsed += wait_interval
+ print(f"Storage {storage_id} not ready after {max_wait}s")
+
+
+def get_storage(*, client: Gcore, storage_id: int) -> None:
+ """Get and display details for a single storage"""
+ print("\n=== GET STORAGE DETAILS ===")
+ storage = client.storage.get(storage_id=storage_id)
+ print(
+ f"Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
+ )
+ print(f"Address: {storage.address}, Created: {storage.created_at}, Can Restore: {storage.can_restore}")
+ print("===========================")
+
+
+def generate_s3_keys(*, client: Gcore, s3_storage_id: int) -> None:
+ print("\n=== GENERATE S3 KEYS ===")
+ storage = client.storage.credentials.recreate(
+ storage_id=s3_storage_id,
+ generate_s3_keys=True,
+ )
+ if storage.credentials and storage.credentials.s3:
+ print(f"Generated new S3 keys for storage {s3_storage_id}")
+ print(f"Access Key: {storage.credentials.s3.access_key}")
+ print(f"Secret Key: {storage.credentials.s3.secret_key}")
+ print("========================")
+
+
+def generate_sftp_password(*, client: Gcore, sftp_storage_id: int) -> None:
+ print("\n=== GENERATE SFTP PASSWORD ===")
+ storage = client.storage.credentials.recreate(
+ storage_id=sftp_storage_id,
+ generate_sftp_password=True,
+ )
+ if storage.credentials and storage.credentials.sftp_password:
+ print(f"Generated SFTP password for storage {sftp_storage_id}: {storage.credentials.sftp_password}")
+ print("==============================")
+
+
+def set_custom_sftp_password(*, client: Gcore, sftp_storage_id: int) -> None:
+ print("\n=== SET CUSTOM SFTP PASSWORD ===")
+ custom_password = "MyNewSecurePassword456!"
+ client.storage.credentials.recreate(
+ storage_id=sftp_storage_id,
+ sftp_password=custom_password,
+ )
+ print(f"Set custom SFTP password for storage {sftp_storage_id}: {custom_password}")
+ print("================================")
+
+
+def delete_sftp_password(*, client: Gcore, sftp_storage_id: int) -> None:
+ print("\n=== DELETE SFTP PASSWORD ===")
+ client.storage.credentials.recreate(
+ storage_id=sftp_storage_id,
+ delete_sftp_password=True,
+ )
+ print(f"Deleted SFTP password for storage {sftp_storage_id}")
+ print("============================")
+
+
+def delete_storage(*, client: Gcore, storage_id: int) -> None:
+ """Delete a single storage"""
+ print("\n=== DELETE STORAGE ===")
+ client.storage.delete(storage_id=storage_id)
+ print(f"Storage {storage_id} deleted successfully")
+ print("======================")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/storage/credentials_async.py b/examples/storage/credentials_async.py
new file mode 100644
index 00000000..80ab67c5
--- /dev/null
+++ b/examples/storage/credentials_async.py
@@ -0,0 +1,146 @@
+import time
+import asyncio
+
+from gcore import AsyncGcore
+
+
+async def main() -> None:
+ # TODO set API key before running
+ # api_key = os.environ["GCORE_API_KEY"]
+
+ gcore = AsyncGcore(
+ # No need to explicitly pass to AsyncGcore constructor if using environment variables
+ # api_key=api_key,
+ )
+
+ # S3
+ s3_storage_id = await create_s3_storage(client=gcore)
+ await get_storage(client=gcore, storage_id=s3_storage_id)
+ await generate_s3_keys(client=gcore, s3_storage_id=s3_storage_id)
+ await delete_storage(client=gcore, storage_id=s3_storage_id)
+
+ # SFTP storage operations
+ sftp_storage_id = await create_sftp_storage(client=gcore)
+ await get_storage(client=gcore, storage_id=sftp_storage_id)
+ await generate_sftp_password(client=gcore, sftp_storage_id=sftp_storage_id)
+ await delete_sftp_password(client=gcore, sftp_storage_id=sftp_storage_id)
+ await set_custom_sftp_password(client=gcore, sftp_storage_id=sftp_storage_id)
+ await delete_storage(client=gcore, storage_id=sftp_storage_id)
+
+
+async def create_s3_storage(*, client: AsyncGcore) -> int:
+ print("\n=== CREATE S3 STORAGE ===")
+ s3_name = f"s3-creds-example-{int(time.time())}"
+ storage = await client.storage.create(
+ name=s3_name,
+ type="s3",
+ location="s-ed1",
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ if storage.credentials and storage.credentials.s3:
+ print(f"S3 Access Key: {storage.credentials.s3.access_key}")
+ print(f"S3 Secret Key: {storage.credentials.s3.secret_key}")
+ print("=========================")
+ return storage.id
+
+
+async def create_sftp_storage(*, client: AsyncGcore) -> int:
+ print("\n=== CREATE SFTP STORAGE ===")
+ sftp_name = f"sftp-ex-{int(time.time()) % 1000000}"
+ storage = await client.storage.create(
+ name=sftp_name,
+ type="sftp",
+ location="ams",
+ generate_sftp_password=True,
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ if storage.credentials and storage.credentials.sftp_password:
+ print(f"SFTP Password: {storage.credentials.sftp_password}")
+ print("==========================")
+ return storage.id
+
+
+async def wait_for_storage_provisioning(
+ *, client: AsyncGcore, storage_id: int, max_wait: int = 30, wait_interval: int = 2
+) -> None:
+ """Wait for a single storage to be provisioned"""
+ elapsed = 0
+ while elapsed < max_wait:
+ storage = await client.storage.get(storage_id=storage_id)
+ if storage.provisioning_status == "ok":
+ print(f"Storage {storage_id} is ready")
+ return
+ print(f"Storage {storage_id} status: {storage.provisioning_status}, waiting...")
+ await asyncio.sleep(wait_interval)
+ elapsed += wait_interval
+ print(f"Storage {storage_id} not ready after {max_wait}s")
+
+
+async def get_storage(*, client: AsyncGcore, storage_id: int) -> None:
+ """Get and display details for a single storage"""
+ print("\n=== GET STORAGE DETAILS ===")
+ storage = await client.storage.get(storage_id=storage_id)
+ print(
+ f"Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
+ )
+ print(f"Address: {storage.address}, Created: {storage.created_at}, Can Restore: {storage.can_restore}")
+ print("===========================")
+
+
+async def generate_s3_keys(*, client: AsyncGcore, s3_storage_id: int) -> None:
+ print("\n=== GENERATE S3 KEYS ===")
+ storage = await client.storage.credentials.recreate(
+ storage_id=s3_storage_id,
+ generate_s3_keys=True,
+ )
+ if storage.credentials and storage.credentials.s3:
+ print(f"Generated new S3 keys for storage {s3_storage_id}")
+ print(f"Access Key: {storage.credentials.s3.access_key}")
+ print(f"Secret Key: {storage.credentials.s3.secret_key}")
+ print("========================")
+
+
+async def generate_sftp_password(*, client: AsyncGcore, sftp_storage_id: int) -> None:
+ print("\n=== GENERATE SFTP PASSWORD ===")
+ storage = await client.storage.credentials.recreate(
+ storage_id=sftp_storage_id,
+ generate_sftp_password=True,
+ )
+ if storage.credentials and storage.credentials.sftp_password:
+ print(f"Generated SFTP password for storage {sftp_storage_id}: {storage.credentials.sftp_password}")
+ print("==============================")
+
+
+async def set_custom_sftp_password(*, client: AsyncGcore, sftp_storage_id: int) -> None:
+ print("\n=== SET CUSTOM SFTP PASSWORD ===")
+ custom_password = "MyNewSecurePassword456!"
+ await client.storage.credentials.recreate(
+ storage_id=sftp_storage_id,
+ sftp_password=custom_password,
+ )
+ print(f"Set custom SFTP password for storage {sftp_storage_id}: {custom_password}")
+ print("================================")
+
+
+async def delete_sftp_password(*, client: AsyncGcore, sftp_storage_id: int) -> None:
+ print("\n=== DELETE SFTP PASSWORD ===")
+ await client.storage.credentials.recreate(
+ storage_id=sftp_storage_id,
+ delete_sftp_password=True,
+ )
+ print(f"Deleted SFTP password for storage {sftp_storage_id}")
+ print("============================")
+
+
+async def delete_storage(*, client: AsyncGcore, storage_id: int) -> None:
+ """Delete a single storage"""
+ print("\n=== DELETE STORAGE ===")
+ await client.storage.delete(storage_id=storage_id)
+ print(f"Storage {storage_id} deleted successfully")
+ print("======================")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/examples/storage/s3_buckets.py b/examples/storage/s3_buckets.py
new file mode 100644
index 00000000..fa7a3029
--- /dev/null
+++ b/examples/storage/s3_buckets.py
@@ -0,0 +1,137 @@
+from __future__ import annotations
+
+import time
+
+from gcore import Gcore
+
+
+def main() -> None:
+ # TODO set API key before running
+ # api_key = os.environ["GCORE_API_KEY"]
+
+ gcore = Gcore(
+ # No need to explicitly pass to Gcore constructor if using environment variables
+ # api_key=api_key,
+ )
+
+ storage_id = create_s3_storage(client=gcore)
+ wait_for_storage_provisioning(client=gcore, storage_id=storage_id)
+
+ bucket_name = create_bucket(client=gcore, storage_id=storage_id)
+ list_buckets(client=gcore, storage_id=storage_id)
+ set_bucket_lifecycle(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ set_bucket_cors(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ set_bucket_policy(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ list_buckets(client=gcore, storage_id=storage_id)
+ delete_bucket(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+
+ delete_storage(client=gcore, storage_id=storage_id)
+
+
+def create_s3_storage(*, client: Gcore) -> int:
+ print("\n=== CREATE S3 STORAGE ===")
+ storage_name = f"s3-bucket-example-{int(time.time())}"
+ storage = client.storage.create(
+ name=storage_name,
+ type="s3",
+ location="s-ed1",
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ print(f"S3 Access Key: {storage.credentials.s3.access_key}") # type: ignore[union-attr]
+ print(f"S3 Secret Key: {storage.credentials.s3.secret_key}") # type: ignore[union-attr]
+ print("=========================")
+ return storage.id
+
+
+def wait_for_storage_provisioning(*, client: Gcore, storage_id: int) -> None:
+ print("\n=== WAIT FOR STORAGE PROVISIONING ===")
+ max_wait = 30
+ wait_interval = 2
+ elapsed = 0
+ while elapsed < max_wait:
+ storage = client.storage.get(storage_id=storage_id)
+ if storage.provisioning_status == "ok":
+ print(f"Storage {storage_id} is ready")
+ print("=====================================")
+ return
+ print(f"Storage {storage_id} status: {storage.provisioning_status}, waiting...")
+ time.sleep(wait_interval)
+ elapsed += wait_interval
+ print(f"Storage {storage_id} not ready, proceeding anyway...")
+ print("=====================================")
+
+
+def create_bucket(*, client: Gcore, storage_id: int) -> str:
+ print("\n=== CREATE BUCKET ===")
+ timestamp = int(time.time())
+ bucket_name = f"example-bucket-{timestamp}"
+ client.storage.buckets.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ )
+ print(f"Created bucket: {bucket_name}")
+ print("=====================")
+ return bucket_name
+
+
+def list_buckets(*, client: Gcore, storage_id: int) -> None:
+ print("\n=== LIST BUCKETS ===")
+ buckets = client.storage.buckets.list(storage_id=storage_id)
+ for count, bucket in enumerate(buckets, 1):
+ lifecycle_info = f", Lifecycle: {bucket.lifecycle} days" if bucket.lifecycle and bucket.lifecycle > 0 else ""
+ print(f" {count}. Bucket: Name={bucket.name}{lifecycle_info}")
+ print("====================")
+
+
+def set_bucket_lifecycle(*, client: Gcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== SET BUCKET LIFECYCLE ===")
+ client.storage.buckets.lifecycle.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ expiration_days=30,
+ )
+ print(f"Set lifecycle policy for bucket {bucket_name}: objects expire after 30 days")
+ print("============================")
+
+
+def set_bucket_cors(*, client: Gcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== SET BUCKET CORS ===")
+ client.storage.buckets.cors.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ allowed_origins=["*"],
+ )
+ print(f"Set CORS policy for bucket {bucket_name} with origins: ['*']")
+ print("=======================")
+
+
+def set_bucket_policy(*, client: Gcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== SET BUCKET POLICY ===")
+ client.storage.buckets.policy.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ )
+ print(f"Set public read policy for bucket {bucket_name}")
+ print("=========================")
+
+
+def delete_bucket(*, client: Gcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== DELETE BUCKET ===")
+ client.storage.buckets.delete(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ )
+ print(f"Deleted bucket: {bucket_name}")
+ print("=====================")
+
+
+def delete_storage(*, client: Gcore, storage_id: int) -> None:
+ print("\n=== DELETE STORAGE ===")
+ client.storage.delete(storage_id=storage_id)
+ print(f"Storage {storage_id} deleted successfully")
+ print("======================")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/storage/s3_buckets_async.py b/examples/storage/s3_buckets_async.py
new file mode 100644
index 00000000..fc372e13
--- /dev/null
+++ b/examples/storage/s3_buckets_async.py
@@ -0,0 +1,137 @@
+from __future__ import annotations
+
+import time
+import asyncio
+
+from gcore import AsyncGcore
+
+
+async def main() -> None:
+ # TODO set API key before running
+ # api_key = os.environ["GCORE_API_KEY"]
+
+ gcore = AsyncGcore(
+ # No need to explicitly pass to AsyncGcore constructor if using environment variables
+ # api_key=api_key,
+ )
+
+ storage_id = await create_s3_storage(client=gcore)
+ await wait_for_storage_provisioning(client=gcore, storage_id=storage_id)
+ bucket_name = await create_bucket(client=gcore, storage_id=storage_id)
+ await list_buckets(client=gcore, storage_id=storage_id)
+ await set_bucket_lifecycle(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ await set_bucket_cors(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ await set_bucket_policy(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ await list_buckets(client=gcore, storage_id=storage_id)
+ await delete_bucket(client=gcore, storage_id=storage_id, bucket_name=bucket_name)
+ await delete_storage(client=gcore, storage_id=storage_id)
+
+
+async def create_s3_storage(*, client: AsyncGcore) -> int:
+ print("\n=== CREATE S3 STORAGE ===")
+ storage_name = f"s3-bucket-example-{int(time.time())}"
+ storage = await client.storage.create(
+ name=storage_name,
+ type="s3",
+ location="s-ed1",
+ )
+ print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
+ print(f"Storage address: {storage.address}")
+ print(f"S3 Access Key: {storage.credentials.s3.access_key}") # type: ignore[union-attr]
+ print(f"S3 Secret Key: {storage.credentials.s3.secret_key}") # type: ignore[union-attr]
+ print("=========================")
+ return storage.id
+
+
+async def wait_for_storage_provisioning(*, client: AsyncGcore, storage_id: int) -> None:
+ print("\n=== WAIT FOR STORAGE PROVISIONING ===")
+ max_wait = 30
+ wait_interval = 2
+ elapsed = 0
+ while elapsed < max_wait:
+ storage = await client.storage.get(storage_id=storage_id)
+ if storage.provisioning_status == "ok":
+ print(f"Storage {storage_id} is ready")
+ print("=====================================")
+ return
+ print(f"Storage {storage_id} status: {storage.provisioning_status}, waiting...")
+ await asyncio.sleep(wait_interval)
+ elapsed += wait_interval
+ print(f"Storage {storage_id} not ready, proceeding anyway...")
+ print("=====================================")
+
+
+async def create_bucket(*, client: AsyncGcore, storage_id: int) -> str:
+ print("\n=== CREATE BUCKET ===")
+ timestamp = int(time.time())
+ bucket_name = f"example-bucket-{timestamp}"
+ await client.storage.buckets.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ )
+ print(f"Created bucket: {bucket_name}")
+ print("=====================")
+ return bucket_name
+
+
+async def list_buckets(*, client: AsyncGcore, storage_id: int) -> None:
+ print("\n=== LIST BUCKETS ===")
+ count = 1
+ async for bucket in client.storage.buckets.list(storage_id=storage_id):
+ lifecycle_info = f", Lifecycle: {bucket.lifecycle} days" if bucket.lifecycle and bucket.lifecycle > 0 else ""
+ print(f" {count}. Bucket: Name={bucket.name}{lifecycle_info}")
+ count += 1
+ print("====================")
+
+
+async def set_bucket_lifecycle(*, client: AsyncGcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== SET BUCKET LIFECYCLE ===")
+ await client.storage.buckets.lifecycle.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ expiration_days=30,
+ )
+ print(f"Set lifecycle policy for bucket {bucket_name}: objects expire after 30 days")
+ print("============================")
+
+
+async def set_bucket_cors(*, client: AsyncGcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== SET BUCKET CORS ===")
+ await client.storage.buckets.cors.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ allowed_origins=["*"],
+ )
+ print(f"Set CORS policy for bucket {bucket_name} with origins: ['*']")
+ print("=======================")
+
+
+async def set_bucket_policy(*, client: AsyncGcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== SET BUCKET POLICY ===")
+ await client.storage.buckets.policy.create(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ )
+ print(f"Set public read policy for bucket {bucket_name}")
+ print("=========================")
+
+
+async def delete_bucket(*, client: AsyncGcore, storage_id: int, bucket_name: str) -> None:
+ print("\n=== DELETE BUCKET ===")
+ await client.storage.buckets.delete(
+ bucket_name=bucket_name,
+ storage_id=storage_id,
+ )
+ print(f"Deleted bucket: {bucket_name}")
+ print("=====================")
+
+
+async def delete_storage(*, client: AsyncGcore, storage_id: int) -> None:
+ print("\n=== DELETE STORAGE ===")
+ await client.storage.delete(storage_id=storage_id)
+ print(f"Storage {storage_id} deleted successfully")
+ print("======================")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/pyproject.toml b/pyproject.toml
index 4639d182..ae458cfd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "gcore"
-version = "0.21.0"
+version = "0.22.0"
description = "The official Python library for the gcore API"
dynamic = ["readme"]
license = "Apache-2.0"
@@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
diff --git a/src/gcore/_version.py b/src/gcore/_version.py
index 13d7c069..58fc4d82 100644
--- a/src/gcore/_version.py
+++ b/src/gcore/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "gcore"
-__version__ = "0.21.0" # x-release-please-version
+__version__ = "0.22.0" # x-release-please-version
diff --git a/src/gcore/resources/cloud/__init__.py b/src/gcore/resources/cloud/__init__.py
index 6ae9dac7..aa77fd72 100644
--- a/src/gcore/resources/cloud/__init__.py
+++ b/src/gcore/resources/cloud/__init__.py
@@ -1,12 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .k8s import (
- K8sResource,
- AsyncK8sResource,
- K8sResourceWithRawResponse,
- AsyncK8sResourceWithRawResponse,
- K8sResourceWithStreamingResponse,
- AsyncK8sResourceWithStreamingResponse,
+ K8SResource,
+ AsyncK8SResource,
+ K8SResourceWithRawResponse,
+ AsyncK8SResourceWithRawResponse,
+ K8SResourceWithStreamingResponse,
+ AsyncK8SResourceWithStreamingResponse,
)
from .cloud import (
CloudResource,
@@ -372,12 +372,12 @@
"AsyncInstancesResourceWithRawResponse",
"InstancesResourceWithStreamingResponse",
"AsyncInstancesResourceWithStreamingResponse",
- "K8sResource",
- "AsyncK8sResource",
- "K8sResourceWithRawResponse",
- "AsyncK8sResourceWithRawResponse",
- "K8sResourceWithStreamingResponse",
- "AsyncK8sResourceWithStreamingResponse",
+ "K8SResource",
+ "AsyncK8SResource",
+ "K8SResourceWithRawResponse",
+ "AsyncK8SResourceWithRawResponse",
+ "K8SResourceWithStreamingResponse",
+ "AsyncK8SResourceWithStreamingResponse",
"AuditLogsResource",
"AsyncAuditLogsResource",
"AuditLogsResourceWithRawResponse",
diff --git a/src/gcore/resources/cloud/baremetal/servers.py b/src/gcore/resources/cloud/baremetal/servers.py
index 29c23154..14aca2a2 100644
--- a/src/gcore/resources/cloud/baremetal/servers.py
+++ b/src/gcore/resources/cloud/baremetal/servers.py
@@ -135,9 +135,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
user_data: String in base64 format. For Linux instances, '`user_data`' is ignored when
'password' field is provided. For Windows instances, Admin user password is set
@@ -626,9 +627,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
user_data: String in base64 format. For Linux instances, '`user_data`' is ignored when
'password' field is provided. For Windows instances, Admin user password is set
diff --git a/src/gcore/resources/cloud/cloud.py b/src/gcore/resources/cloud/cloud.py
index 3f9ad996..6147e663 100644
--- a/src/gcore/resources/cloud/cloud.py
+++ b/src/gcore/resources/cloud/cloud.py
@@ -11,12 +11,12 @@
AsyncTasksResourceWithStreamingResponse,
)
from .k8s.k8s import (
- K8sResource,
- AsyncK8sResource,
- K8sResourceWithRawResponse,
- AsyncK8sResourceWithRawResponse,
- K8sResourceWithStreamingResponse,
- AsyncK8sResourceWithStreamingResponse,
+ K8SResource,
+ AsyncK8SResource,
+ K8SResourceWithRawResponse,
+ AsyncK8SResourceWithRawResponse,
+ K8SResourceWithStreamingResponse,
+ AsyncK8SResourceWithStreamingResponse,
)
from .regions import (
RegionsResource,
@@ -333,8 +333,8 @@ def instances(self) -> InstancesResource:
return InstancesResource(self._client)
@cached_property
- def k8s(self) -> K8sResource:
- return K8sResource(self._client)
+ def k8s(self) -> K8SResource:
+ return K8SResource(self._client)
@cached_property
def audit_logs(self) -> AuditLogsResource:
@@ -473,8 +473,8 @@ def instances(self) -> AsyncInstancesResource:
return AsyncInstancesResource(self._client)
@cached_property
- def k8s(self) -> AsyncK8sResource:
- return AsyncK8sResource(self._client)
+ def k8s(self) -> AsyncK8SResource:
+ return AsyncK8SResource(self._client)
@cached_property
def audit_logs(self) -> AsyncAuditLogsResource:
@@ -616,8 +616,8 @@ def instances(self) -> InstancesResourceWithRawResponse:
return InstancesResourceWithRawResponse(self._cloud.instances)
@cached_property
- def k8s(self) -> K8sResourceWithRawResponse:
- return K8sResourceWithRawResponse(self._cloud.k8s)
+ def k8s(self) -> K8SResourceWithRawResponse:
+ return K8SResourceWithRawResponse(self._cloud.k8s)
@cached_property
def audit_logs(self) -> AuditLogsResourceWithRawResponse:
@@ -740,8 +740,8 @@ def instances(self) -> AsyncInstancesResourceWithRawResponse:
return AsyncInstancesResourceWithRawResponse(self._cloud.instances)
@cached_property
- def k8s(self) -> AsyncK8sResourceWithRawResponse:
- return AsyncK8sResourceWithRawResponse(self._cloud.k8s)
+ def k8s(self) -> AsyncK8SResourceWithRawResponse:
+ return AsyncK8SResourceWithRawResponse(self._cloud.k8s)
@cached_property
def audit_logs(self) -> AsyncAuditLogsResourceWithRawResponse:
@@ -864,8 +864,8 @@ def instances(self) -> InstancesResourceWithStreamingResponse:
return InstancesResourceWithStreamingResponse(self._cloud.instances)
@cached_property
- def k8s(self) -> K8sResourceWithStreamingResponse:
- return K8sResourceWithStreamingResponse(self._cloud.k8s)
+ def k8s(self) -> K8SResourceWithStreamingResponse:
+ return K8SResourceWithStreamingResponse(self._cloud.k8s)
@cached_property
def audit_logs(self) -> AuditLogsResourceWithStreamingResponse:
@@ -988,8 +988,8 @@ def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
return AsyncInstancesResourceWithStreamingResponse(self._cloud.instances)
@cached_property
- def k8s(self) -> AsyncK8sResourceWithStreamingResponse:
- return AsyncK8sResourceWithStreamingResponse(self._cloud.k8s)
+ def k8s(self) -> AsyncK8SResourceWithStreamingResponse:
+ return AsyncK8SResourceWithStreamingResponse(self._cloud.k8s)
@cached_property
def audit_logs(self) -> AsyncAuditLogsResourceWithStreamingResponse:
diff --git a/src/gcore/resources/cloud/file_shares/file_shares.py b/src/gcore/resources/cloud/file_shares/file_shares.py
index a9097c32..90861f62 100644
--- a/src/gcore/resources/cloud/file_shares/file_shares.py
+++ b/src/gcore/resources/cloud/file_shares/file_shares.py
@@ -105,9 +105,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Standard file share type
@@ -161,9 +162,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Vast file share type
@@ -633,9 +635,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Standard file share type
@@ -689,9 +692,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Vast file share type
diff --git a/src/gcore/resources/cloud/floating_ips.py b/src/gcore/resources/cloud/floating_ips.py
index 07729b29..319627bc 100644
--- a/src/gcore/resources/cloud/floating_ips.py
+++ b/src/gcore/resources/cloud/floating_ips.py
@@ -90,9 +90,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -593,9 +594,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py b/src/gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py
index 32023e05..76cfb8d8 100644
--- a/src/gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py
+++ b/src/gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py
@@ -141,9 +141,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -865,9 +866,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/gpu_baremetal_clusters/images.py b/src/gcore/resources/cloud/gpu_baremetal_clusters/images.py
index 036a98d9..26711e88 100644
--- a/src/gcore/resources/cloud/gpu_baremetal_clusters/images.py
+++ b/src/gcore/resources/cloud/gpu_baremetal_clusters/images.py
@@ -265,9 +265,10 @@ def upload(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -612,9 +613,10 @@ async def upload(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py b/src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py
index 59d7b44a..6d00751f 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py
+++ b/src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py
@@ -148,9 +148,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -797,9 +798,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/images.py b/src/gcore/resources/cloud/gpu_virtual_clusters/images.py
index 47315e2a..8d408ad5 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/images.py
+++ b/src/gcore/resources/cloud/gpu_virtual_clusters/images.py
@@ -227,9 +227,10 @@ def upload(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -468,9 +469,10 @@ async def upload(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/instances/images.py b/src/gcore/resources/cloud/instances/images.py
index cb32712a..8737a631 100644
--- a/src/gcore/resources/cloud/instances/images.py
+++ b/src/gcore/resources/cloud/instances/images.py
@@ -91,9 +91,10 @@ def update(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -321,9 +322,10 @@ def create_from_volume(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -523,9 +525,10 @@ def upload(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -689,9 +692,10 @@ async def update(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -919,9 +923,10 @@ async def create_from_volume(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -1121,9 +1126,10 @@ async def upload(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/instances/instances.py b/src/gcore/resources/cloud/instances/instances.py
index 3c127361..87e224e7 100644
--- a/src/gcore/resources/cloud/instances/instances.py
+++ b/src/gcore/resources/cloud/instances/instances.py
@@ -210,9 +210,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
user_data: String in base64 format. For Linux instances, '`user_data`' is ignored when
'password' field is provided. For Windows instances, Admin user password is set
@@ -1633,9 +1634,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
user_data: String in base64 format. For Linux instances, '`user_data`' is ignored when
'password' field is provided. For Windows instances, Admin user password is set
diff --git a/src/gcore/resources/cloud/k8s/__init__.py b/src/gcore/resources/cloud/k8s/__init__.py
index 6b5f189d..26af76b8 100644
--- a/src/gcore/resources/cloud/k8s/__init__.py
+++ b/src/gcore/resources/cloud/k8s/__init__.py
@@ -1,12 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .k8s import (
- K8sResource,
- AsyncK8sResource,
- K8sResourceWithRawResponse,
- AsyncK8sResourceWithRawResponse,
- K8sResourceWithStreamingResponse,
- AsyncK8sResourceWithStreamingResponse,
+ K8SResource,
+ AsyncK8SResource,
+ K8SResourceWithRawResponse,
+ AsyncK8SResourceWithRawResponse,
+ K8SResourceWithStreamingResponse,
+ AsyncK8SResourceWithStreamingResponse,
)
from .flavors import (
FlavorsResource,
@@ -38,10 +38,10 @@
"AsyncClustersResourceWithRawResponse",
"ClustersResourceWithStreamingResponse",
"AsyncClustersResourceWithStreamingResponse",
- "K8sResource",
- "AsyncK8sResource",
- "K8sResourceWithRawResponse",
- "AsyncK8sResourceWithRawResponse",
- "K8sResourceWithStreamingResponse",
- "AsyncK8sResourceWithStreamingResponse",
+ "K8SResource",
+ "AsyncK8SResource",
+ "K8SResourceWithRawResponse",
+ "AsyncK8SResourceWithRawResponse",
+ "K8SResourceWithStreamingResponse",
+ "AsyncK8SResourceWithStreamingResponse",
]
diff --git a/src/gcore/resources/cloud/k8s/clusters/clusters.py b/src/gcore/resources/cloud/k8s/clusters/clusters.py
index cda6a936..52ab2f78 100644
--- a/src/gcore/resources/cloud/k8s/clusters/clusters.py
+++ b/src/gcore/resources/cloud/k8s/clusters/clusters.py
@@ -40,11 +40,11 @@
cluster_upgrade_params,
)
from .....types.cloud.task_id_list import TaskIDList
-from .....types.cloud.k8s.k8s_cluster import K8sCluster
-from .....types.cloud.k8s.k8s_cluster_list import K8sClusterList
-from .....types.cloud.k8s_cluster_version_list import K8sClusterVersionList
-from .....types.cloud.k8s.k8s_cluster_kubeconfig import K8sClusterKubeconfig
-from .....types.cloud.k8s.k8s_cluster_certificate import K8sClusterCertificate
+from .....types.cloud.k8s.k8s_cluster import K8SCluster
+from .....types.cloud.k8s.k8s_cluster_list import K8SClusterList
+from .....types.cloud.k8s_cluster_version_list import K8SClusterVersionList
+from .....types.cloud.k8s.k8s_cluster_kubeconfig import K8SClusterKubeconfig
+from .....types.cloud.k8s.k8s_cluster_certificate import K8SClusterCertificate
__all__ = ["ClustersResource", "AsyncClustersResource"]
@@ -381,7 +381,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterList:
+ ) -> K8SClusterList:
"""
List k8s clusters
@@ -403,7 +403,7 @@ def list(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterList,
+ cast_to=K8SClusterList,
)
def delete(
@@ -464,7 +464,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sCluster:
+ ) -> K8SCluster:
"""
Get k8s cluster
@@ -488,7 +488,7 @@ def get(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sCluster,
+ cast_to=K8SCluster,
)
def get_certificate(
@@ -503,7 +503,7 @@ def get_certificate(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterCertificate:
+ ) -> K8SClusterCertificate:
"""
Get k8s cluster CA certificate
@@ -527,7 +527,7 @@ def get_certificate(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterCertificate,
+ cast_to=K8SClusterCertificate,
)
def get_kubeconfig(
@@ -542,7 +542,7 @@ def get_kubeconfig(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterKubeconfig:
+ ) -> K8SClusterKubeconfig:
"""
Get k8s cluster kubeconfig
@@ -566,7 +566,7 @@ def get_kubeconfig(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterKubeconfig,
+ cast_to=K8SClusterKubeconfig,
)
def list_versions_for_upgrade(
@@ -581,7 +581,7 @@ def list_versions_for_upgrade(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterVersionList:
+ ) -> K8SClusterVersionList:
"""
List available k8s cluster versions for upgrade
@@ -605,7 +605,7 @@ def list_versions_for_upgrade(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterVersionList,
+ cast_to=K8SClusterVersionList,
)
def upgrade(
@@ -984,7 +984,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterList:
+ ) -> K8SClusterList:
"""
List k8s clusters
@@ -1006,7 +1006,7 @@ async def list(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterList,
+ cast_to=K8SClusterList,
)
async def delete(
@@ -1067,7 +1067,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sCluster:
+ ) -> K8SCluster:
"""
Get k8s cluster
@@ -1091,7 +1091,7 @@ async def get(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sCluster,
+ cast_to=K8SCluster,
)
async def get_certificate(
@@ -1106,7 +1106,7 @@ async def get_certificate(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterCertificate:
+ ) -> K8SClusterCertificate:
"""
Get k8s cluster CA certificate
@@ -1130,7 +1130,7 @@ async def get_certificate(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterCertificate,
+ cast_to=K8SClusterCertificate,
)
async def get_kubeconfig(
@@ -1145,7 +1145,7 @@ async def get_kubeconfig(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterKubeconfig:
+ ) -> K8SClusterKubeconfig:
"""
Get k8s cluster kubeconfig
@@ -1169,7 +1169,7 @@ async def get_kubeconfig(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterKubeconfig,
+ cast_to=K8SClusterKubeconfig,
)
async def list_versions_for_upgrade(
@@ -1184,7 +1184,7 @@ async def list_versions_for_upgrade(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterVersionList:
+ ) -> K8SClusterVersionList:
"""
List available k8s cluster versions for upgrade
@@ -1208,7 +1208,7 @@ async def list_versions_for_upgrade(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterVersionList,
+ cast_to=K8SClusterVersionList,
)
async def upgrade(
diff --git a/src/gcore/resources/cloud/k8s/clusters/pools/pools.py b/src/gcore/resources/cloud/k8s/clusters/pools/pools.py
index 72cb9321..6cc9863a 100644
--- a/src/gcore/resources/cloud/k8s/clusters/pools/pools.py
+++ b/src/gcore/resources/cloud/k8s/clusters/pools/pools.py
@@ -28,8 +28,8 @@
from ......_base_client import make_request_options
from ......types.cloud.k8s.clusters import pool_create_params, pool_resize_params, pool_update_params
from ......types.cloud.task_id_list import TaskIDList
-from ......types.cloud.k8s.clusters.k8s_cluster_pool import K8sClusterPool
-from ......types.cloud.k8s.clusters.k8s_cluster_pool_list import K8sClusterPoolList
+from ......types.cloud.k8s.clusters.k8s_cluster_pool import K8SClusterPool
+from ......types.cloud.k8s.clusters.k8s_cluster_pool_list import K8SClusterPoolList
__all__ = ["PoolsResource", "AsyncPoolsResource"]
@@ -174,7 +174,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterPool:
+ ) -> K8SClusterPool:
"""
Update k8s cluster pool
@@ -223,7 +223,7 @@ def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterPool,
+ cast_to=K8SClusterPool,
)
def list(
@@ -238,7 +238,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterPoolList:
+ ) -> K8SClusterPoolList:
"""
List k8s cluster pools
@@ -262,7 +262,7 @@ def list(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterPoolList,
+ cast_to=K8SClusterPoolList,
)
def delete(
@@ -320,7 +320,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterPool:
+ ) -> K8SClusterPool:
"""
Get k8s cluster pool
@@ -346,7 +346,7 @@ def get(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterPool,
+ cast_to=K8SClusterPool,
)
def resize(
@@ -536,7 +536,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterPool:
+ ) -> K8SClusterPool:
"""
Update k8s cluster pool
@@ -585,7 +585,7 @@ async def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterPool,
+ cast_to=K8SClusterPool,
)
async def list(
@@ -600,7 +600,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterPoolList:
+ ) -> K8SClusterPoolList:
"""
List k8s cluster pools
@@ -624,7 +624,7 @@ async def list(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterPoolList,
+ cast_to=K8SClusterPoolList,
)
async def delete(
@@ -682,7 +682,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterPool:
+ ) -> K8SClusterPool:
"""
Get k8s cluster pool
@@ -708,7 +708,7 @@ async def get(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterPool,
+ cast_to=K8SClusterPool,
)
async def resize(
diff --git a/src/gcore/resources/cloud/k8s/k8s.py b/src/gcore/resources/cloud/k8s/k8s.py
index f3ac5aff..e1dabed0 100644
--- a/src/gcore/resources/cloud/k8s/k8s.py
+++ b/src/gcore/resources/cloud/k8s/k8s.py
@@ -30,12 +30,12 @@
ClustersResourceWithStreamingResponse,
AsyncClustersResourceWithStreamingResponse,
)
-from ....types.cloud.k8s_cluster_version_list import K8sClusterVersionList
+from ....types.cloud.k8s_cluster_version_list import K8SClusterVersionList
-__all__ = ["K8sResource", "AsyncK8sResource"]
+__all__ = ["K8SResource", "AsyncK8SResource"]
-class K8sResource(SyncAPIResource):
+class K8SResource(SyncAPIResource):
@cached_property
def flavors(self) -> FlavorsResource:
return FlavorsResource(self._client)
@@ -45,23 +45,23 @@ def clusters(self) -> ClustersResource:
return ClustersResource(self._client)
@cached_property
- def with_raw_response(self) -> K8sResourceWithRawResponse:
+ def with_raw_response(self) -> K8SResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
"""
- return K8sResourceWithRawResponse(self)
+ return K8SResourceWithRawResponse(self)
@cached_property
- def with_streaming_response(self) -> K8sResourceWithStreamingResponse:
+ def with_streaming_response(self) -> K8SResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
"""
- return K8sResourceWithStreamingResponse(self)
+ return K8SResourceWithStreamingResponse(self)
def list_versions(
self,
@@ -74,7 +74,7 @@ def list_versions(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterVersionList:
+ ) -> K8SClusterVersionList:
"""
List available k8s cluster versions for creation
@@ -96,11 +96,11 @@ def list_versions(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterVersionList,
+ cast_to=K8SClusterVersionList,
)
-class AsyncK8sResource(AsyncAPIResource):
+class AsyncK8SResource(AsyncAPIResource):
@cached_property
def flavors(self) -> AsyncFlavorsResource:
return AsyncFlavorsResource(self._client)
@@ -110,23 +110,23 @@ def clusters(self) -> AsyncClustersResource:
return AsyncClustersResource(self._client)
@cached_property
- def with_raw_response(self) -> AsyncK8sResourceWithRawResponse:
+ def with_raw_response(self) -> AsyncK8SResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
"""
- return AsyncK8sResourceWithRawResponse(self)
+ return AsyncK8SResourceWithRawResponse(self)
@cached_property
- def with_streaming_response(self) -> AsyncK8sResourceWithStreamingResponse:
+ def with_streaming_response(self) -> AsyncK8SResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
"""
- return AsyncK8sResourceWithStreamingResponse(self)
+ return AsyncK8SResourceWithStreamingResponse(self)
async def list_versions(
self,
@@ -139,7 +139,7 @@ async def list_versions(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> K8sClusterVersionList:
+ ) -> K8SClusterVersionList:
"""
List available k8s cluster versions for creation
@@ -161,12 +161,12 @@ async def list_versions(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=K8sClusterVersionList,
+ cast_to=K8SClusterVersionList,
)
-class K8sResourceWithRawResponse:
- def __init__(self, k8s: K8sResource) -> None:
+class K8SResourceWithRawResponse:
+ def __init__(self, k8s: K8SResource) -> None:
self._k8s = k8s
self.list_versions = to_raw_response_wrapper(
@@ -182,8 +182,8 @@ def clusters(self) -> ClustersResourceWithRawResponse:
return ClustersResourceWithRawResponse(self._k8s.clusters)
-class AsyncK8sResourceWithRawResponse:
- def __init__(self, k8s: AsyncK8sResource) -> None:
+class AsyncK8SResourceWithRawResponse:
+ def __init__(self, k8s: AsyncK8SResource) -> None:
self._k8s = k8s
self.list_versions = async_to_raw_response_wrapper(
@@ -199,8 +199,8 @@ def clusters(self) -> AsyncClustersResourceWithRawResponse:
return AsyncClustersResourceWithRawResponse(self._k8s.clusters)
-class K8sResourceWithStreamingResponse:
- def __init__(self, k8s: K8sResource) -> None:
+class K8SResourceWithStreamingResponse:
+ def __init__(self, k8s: K8SResource) -> None:
self._k8s = k8s
self.list_versions = to_streamed_response_wrapper(
@@ -216,8 +216,8 @@ def clusters(self) -> ClustersResourceWithStreamingResponse:
return ClustersResourceWithStreamingResponse(self._k8s.clusters)
-class AsyncK8sResourceWithStreamingResponse:
- def __init__(self, k8s: AsyncK8sResource) -> None:
+class AsyncK8SResourceWithStreamingResponse:
+ def __init__(self, k8s: AsyncK8SResource) -> None:
self._k8s = k8s
self.list_versions = async_to_streamed_response_wrapper(
diff --git a/src/gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py b/src/gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py
index f4149fd3..c2bc8c83 100644
--- a/src/gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py
+++ b/src/gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing_extensions import Literal
+from typing_extensions import Literal, overload
import httpx
@@ -15,7 +15,7 @@
AsyncRulesResourceWithStreamingResponse,
)
from ....._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ....._utils import maybe_transform, async_maybe_transform
+from ....._utils import required_args, maybe_transform, async_maybe_transform
from ....._compat import cached_property
from ....._resource import SyncAPIResource, AsyncAPIResource
from ....._response import (
@@ -57,19 +57,18 @@ def with_streaming_response(self) -> L7PoliciesResourceWithStreamingResponse:
"""
return L7PoliciesResourceWithStreamingResponse(self)
+ @overload
def create(
self,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REDIRECT_TO_URL"],
listener_id: str,
+ redirect_url: str,
name: str | Omit = omit,
position: int | Omit = omit,
redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
- redirect_url: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -82,26 +81,172 @@ def create(
Create load balancer L7 policy
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
action: Action
listener_id: Listener ID
+ redirect_url: Requests matching this policy will be redirected to this URL.
+
name: Human-readable name of the policy
- position: The position of this policy on the listener. Positions start at 1.
+ position: The position of this policy on the listener
redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
- URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
- `REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
- redirect_pool_id: Requests matching this policy will be redirected to the pool withthis ID. Only
- valid if action is `REDIRECT_TO_POOL`.
+ tags: A list of simple strings assigned to the resource.
- redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
- if action is `REDIRECT_PREFIX`.
+ extra_headers: Send extra headers
- redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
- action is `REDIRECT_TO_URL`.
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ listener_id: str,
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Create load balancer L7 policy
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ action: Action
+
+ listener_id: Listener ID
+
+ redirect_prefix: Requests matching this policy will be redirected to this Prefix URL.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_POOL"],
+ listener_id: str,
+ redirect_pool_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Create load balancer L7 policy
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ action: Action
+
+ listener_id: Listener ID
+
+ redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REJECT"],
+ listener_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Create load balancer L7 policy
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ action: Action
+
+ listener_id: Listener ID
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
tags: A list of simple strings assigned to the resource.
@@ -113,6 +258,38 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @required_args(
+ ["action", "listener_id", "redirect_url"],
+ ["action", "listener_id", "redirect_prefix"],
+ ["action", "listener_id", "redirect_pool_id"],
+ ["action", "listener_id"],
+ )
+ def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ listener_id: str,
+ redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
if project_id is None:
project_id = self._client._get_cloud_project_id_path_param()
if region_id is None:
@@ -123,13 +300,13 @@ def create(
{
"action": action,
"listener_id": listener_id,
+ "redirect_url": redirect_url,
"name": name,
"position": position,
"redirect_http_code": redirect_http_code,
- "redirect_pool_id": redirect_pool_id,
- "redirect_prefix": redirect_prefix,
- "redirect_url": redirect_url,
"tags": tags,
+ "redirect_prefix": redirect_prefix,
+ "redirect_pool_id": redirect_pool_id,
},
l7_policy_create_params.L7PolicyCreateParams,
),
@@ -155,6 +332,10 @@ def list(
List load balancer L7 policies
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -192,6 +373,12 @@ def delete(
Delete load balancer L7 policy
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -231,6 +418,12 @@ def get(
Get load balancer L7 policy
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -253,19 +446,18 @@ def get(
cast_to=LoadBalancerL7Policy,
)
+ @overload
def replace(
self,
l7policy_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REDIRECT_TO_URL"],
+ redirect_url: str,
name: str | Omit = omit,
position: int | Omit = omit,
redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
- redirect_url: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -274,28 +466,90 @@ def replace(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TaskIDList:
- """
- Replace load balancer L7 policy
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
action: Action
+ redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
+ action is `REDIRECT_TO_URL`.
+
name: Human-readable name of the policy
- position: The position of this policy on the listener. Positions start at 1.
+ position: The position of this policy on the listener
redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
`REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
- redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID. Only
- valid if action is `REDIRECT_TO_POOL`.
+ tags: A list of simple strings assigned to the resource.
- redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
- if action is `REDIRECT_PREFIX`.
+ extra_headers: Send extra headers
- redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
- action is `REDIRECT_TO_URL`.
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def replace(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ action: Action
+
+ redirect_prefix: Requests matching this policy will be redirected to this Prefix URL.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
tags: A list of simple strings assigned to the resource.
@@ -307,57 +561,286 @@ def replace(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not l7policy_id:
- raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
- return self._put(
- f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}",
- body=maybe_transform(
- {
- "action": action,
- "name": name,
- "position": position,
- "redirect_http_code": redirect_http_code,
- "redirect_pool_id": redirect_pool_id,
- "redirect_prefix": redirect_prefix,
- "redirect_url": redirect_url,
- "tags": tags,
- },
- l7_policy_replace_params.L7PolicyReplaceParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=TaskIDList,
- )
+ ...
- def create_and_poll(
+ @overload
+ def replace(
self,
+ l7policy_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
- listener_id: str,
+ action: Literal["REDIRECT_TO_POOL"],
+ redirect_pool_id: str,
name: str | Omit = omit,
position: int | Omit = omit,
- redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
- redirect_url: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
- polling_interval_seconds: int | Omit = omit,
- polling_timeout_seconds: int | Omit = omit,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- ) -> LoadBalancerL7Policy:
- response = self.create(
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ action: Action
+
+ redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def replace(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REJECT"],
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ action: Action
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @required_args(
+ ["action", "redirect_url"], ["action", "redirect_prefix"], ["action", "redirect_pool_id"], ["action"]
+ )
+ def replace(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not l7policy_id:
+ raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
+ return self._put(
+ f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}",
+ body=maybe_transform(
+ {
+ "action": action,
+ "redirect_url": redirect_url,
+ "name": name,
+ "position": position,
+ "redirect_http_code": redirect_http_code,
+ "tags": tags,
+ "redirect_prefix": redirect_prefix,
+ "redirect_pool_id": redirect_pool_id,
+ },
+ l7_policy_replace_params.L7PolicyReplaceParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TaskIDList,
+ )
+
+ @overload
+ def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"],
+ listener_id: str,
+ redirect_url: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @overload
+ def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ listener_id: str,
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @overload
+ def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_POOL"],
+ listener_id: str,
+ redirect_pool_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @overload
+ def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REJECT"],
+ listener_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @required_args(
+ ["action", "listener_id", "redirect_url"],
+ ["action", "listener_id", "redirect_prefix"],
+ ["action", "listener_id", "redirect_pool_id"],
+ ["action", "listener_id"],
+ )
+ def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ listener_id: str,
+ redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ response: TaskIDList = self.create( # type: ignore
project_id=project_id,
region_id=region_id,
action=action,
@@ -374,10 +857,10 @@ def create_and_poll(
extra_body=extra_body,
timeout=timeout,
)
- if not response.tasks or len(response.tasks) != 1:
+ if not response.tasks or len(response.tasks) != 1: # type: ignore[union-attr]
raise ValueError(f"Expected exactly one task to be created")
task = self._client.cloud.tasks.poll(
- task_id=response.tasks[0],
+ task_id=response.tasks[0], # type: ignore[index]
extra_headers=extra_headers,
polling_interval_seconds=polling_interval_seconds,
polling_timeout_seconds=polling_timeout_seconds,
@@ -429,100 +912,348 @@ def delete_and_poll(
polling_timeout_seconds=polling_timeout_seconds,
)
+ @overload
+ def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"],
+ redirect_url: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @overload
+ def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @overload
def replace_and_poll(
self,
l7policy_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REDIRECT_TO_POOL"],
+ redirect_pool_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @overload
+ def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REJECT"],
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @required_args(
+ ["action", "redirect_url"], ["action", "redirect_prefix"], ["action", "redirect_pool_id"], ["action"]
+ )
+ def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ response: TaskIDList = self.replace( # type: ignore
+ l7policy_id=l7policy_id,
+ project_id=project_id,
+ region_id=region_id,
+ action=action,
+ name=name,
+ position=position,
+ redirect_http_code=redirect_http_code,
+ redirect_pool_id=redirect_pool_id,
+ redirect_prefix=redirect_prefix,
+ redirect_url=redirect_url,
+ tags=tags,
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ )
+ if not response.tasks or len(response.tasks) != 1: # type: ignore[union-attr]
+ raise ValueError(f"Expected exactly one task to be created")
+ self._client.cloud.tasks.poll(
+ task_id=response.tasks[0], # type: ignore[index]
+ extra_headers=extra_headers,
+ polling_interval_seconds=polling_interval_seconds,
+ polling_timeout_seconds=polling_timeout_seconds,
+ )
+ return self.get(
+ l7policy_id=l7policy_id,
+ project_id=project_id,
+ region_id=region_id,
+ extra_headers=extra_headers,
+ timeout=timeout,
+ )
+
+
+class AsyncL7PoliciesResource(AsyncAPIResource):
+ @cached_property
+ def rules(self) -> AsyncRulesResource:
+ return AsyncRulesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncL7PoliciesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncL7PoliciesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncL7PoliciesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
+ """
+ return AsyncL7PoliciesResourceWithStreamingResponse(self)
+
+ @overload
+ async def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"],
+ listener_id: str,
+ redirect_url: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Create load balancer L7 policy
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ action: Action
+
+ listener_id: Listener ID
+
+ redirect_url: Requests matching this policy will be redirected to this URL.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ listener_id: str,
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Create load balancer L7 policy
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ action: Action
+
+ listener_id: Listener ID
+
+ redirect_prefix: Requests matching this policy will be redirected to this Prefix URL.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_POOL"],
+ listener_id: str,
+ redirect_pool_id: str,
name: str | Omit = omit,
position: int | Omit = omit,
- redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
- redirect_url: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
- polling_interval_seconds: int | Omit = omit,
- polling_timeout_seconds: int | Omit = omit,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- ) -> LoadBalancerL7Policy:
- response = self.replace(
- l7policy_id=l7policy_id,
- project_id=project_id,
- region_id=region_id,
- action=action,
- name=name,
- position=position,
- redirect_http_code=redirect_http_code,
- redirect_pool_id=redirect_pool_id,
- redirect_prefix=redirect_prefix,
- redirect_url=redirect_url,
- tags=tags,
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- )
- if not response.tasks or len(response.tasks) != 1:
- raise ValueError(f"Expected exactly one task to be created")
- self._client.cloud.tasks.poll(
- task_id=response.tasks[0],
- extra_headers=extra_headers,
- polling_interval_seconds=polling_interval_seconds,
- polling_timeout_seconds=polling_timeout_seconds,
- )
- return self.get(
- l7policy_id=l7policy_id,
- project_id=project_id,
- region_id=region_id,
- extra_headers=extra_headers,
- timeout=timeout,
- )
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Create load balancer L7 policy
+ Args:
+ project_id: Project ID
-class AsyncL7PoliciesResource(AsyncAPIResource):
- @cached_property
- def rules(self) -> AsyncRulesResource:
- return AsyncRulesResource(self._client)
+ region_id: Region ID
- @cached_property
- def with_raw_response(self) -> AsyncL7PoliciesResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
+ action: Action
- For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
- """
- return AsyncL7PoliciesResourceWithRawResponse(self)
+ listener_id: Listener ID
- @cached_property
- def with_streaming_response(self) -> AsyncL7PoliciesResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+ redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID.
- For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
"""
- return AsyncL7PoliciesResourceWithStreamingResponse(self)
+ ...
+ @overload
async def create(
self,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REJECT"],
listener_id: str,
name: str | Omit = omit,
position: int | Omit = omit,
- redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
- redirect_url: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -535,26 +1266,17 @@ async def create(
Create load balancer L7 policy
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
action: Action
listener_id: Listener ID
name: Human-readable name of the policy
- position: The position of this policy on the listener. Positions start at 1.
-
- redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
- URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
- `REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
-
- redirect_pool_id: Requests matching this policy will be redirected to the pool withthis ID. Only
- valid if action is `REDIRECT_TO_POOL`.
-
- redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
- if action is `REDIRECT_PREFIX`.
-
- redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
- action is `REDIRECT_TO_URL`.
+ position: The position of this policy on the listener
tags: A list of simple strings assigned to the resource.
@@ -566,6 +1288,38 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @required_args(
+ ["action", "listener_id", "redirect_url"],
+ ["action", "listener_id", "redirect_prefix"],
+ ["action", "listener_id", "redirect_pool_id"],
+ ["action", "listener_id"],
+ )
+ async def create(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ listener_id: str,
+ redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
if project_id is None:
project_id = self._client._get_cloud_project_id_path_param()
if region_id is None:
@@ -576,13 +1330,13 @@ async def create(
{
"action": action,
"listener_id": listener_id,
+ "redirect_url": redirect_url,
"name": name,
"position": position,
"redirect_http_code": redirect_http_code,
- "redirect_pool_id": redirect_pool_id,
- "redirect_prefix": redirect_prefix,
- "redirect_url": redirect_url,
"tags": tags,
+ "redirect_prefix": redirect_prefix,
+ "redirect_pool_id": redirect_pool_id,
},
l7_policy_create_params.L7PolicyCreateParams,
),
@@ -608,6 +1362,10 @@ async def list(
List load balancer L7 policies
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -644,7 +1402,187 @@ async def delete(
"""
Delete load balancer L7 policy
- Args:
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not l7policy_id:
+ raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
+ return await self._delete(
+ f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TaskIDList,
+ )
+
+ async def get(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LoadBalancerL7Policy:
+ """
+ Get load balancer L7 policy
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not l7policy_id:
+ raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
+ return await self._get(
+ f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=LoadBalancerL7Policy,
+ )
+
+ @overload
+ async def replace(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"],
+ redirect_url: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ action: Action
+
+ redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
+ action is `REDIRECT_TO_URL`.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
+ `REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
+
+ tags: A list of simple strings assigned to the resource.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def replace(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ action: Action
+
+ redirect_prefix: Requests matching this policy will be redirected to this Prefix URL.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
+
+ tags: A list of simple strings assigned to the resource.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -653,37 +1591,51 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not l7policy_id:
- raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
- return await self._delete(
- f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=TaskIDList,
- )
+ ...
- async def get(
+ @overload
+ async def replace(
self,
l7policy_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
+ action: Literal["REDIRECT_TO_POOL"],
+ redirect_pool_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> LoadBalancerL7Policy:
- """
- Get load balancer L7 policy
+ ) -> TaskIDList:
+ """Replaces the entire L7 policy configuration with the provided data.
+
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ action: Action
+
+ redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID.
+
+ name: Human-readable name of the policy
+
+ position: The position of this policy on the listener
+
+ tags: A list of simple strings assigned to the resource.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -692,33 +1644,18 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not l7policy_id:
- raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
- return await self._get(
- f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=LoadBalancerL7Policy,
- )
+ ...
+ @overload
async def replace(
self,
l7policy_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REJECT"],
name: str | Omit = omit,
position: int | Omit = omit,
- redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
- redirect_url: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -727,28 +1664,25 @@ async def replace(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TaskIDList:
- """
- Replace load balancer L7 policy
+ """Replaces the entire L7 policy configuration with the provided data.
- Args:
- action: Action
+ Any fields
+ omitted from the request body will be unset (set to null) or reset to their
+ default values (such as "`redirect_http_code`") depending on the "action". This
+ is a destructive operation that overwrites the complete policy configuration.
- name: Human-readable name of the policy
+ Args:
+ project_id: Project ID
- position: The position of this policy on the listener. Positions start at 1.
+ region_id: Region ID
- redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
- URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
- `REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
+ l7policy_id: L7 policy ID
- redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID. Only
- valid if action is `REDIRECT_TO_POOL`.
+ action: Action
- redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
- if action is `REDIRECT_PREFIX`.
+ name: Human-readable name of the policy
- redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
- action is `REDIRECT_TO_URL`.
+ position: The position of this policy on the listener
tags: A list of simple strings assigned to the resource.
@@ -760,6 +1694,35 @@ async def replace(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @required_args(
+ ["action", "redirect_url"], ["action", "redirect_prefix"], ["action", "redirect_pool_id"], ["action"]
+ )
+ async def replace(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
if project_id is None:
project_id = self._client._get_cloud_project_id_path_param()
if region_id is None:
@@ -771,13 +1734,13 @@ async def replace(
body=await async_maybe_transform(
{
"action": action,
+ "redirect_url": redirect_url,
"name": name,
"position": position,
"redirect_http_code": redirect_http_code,
- "redirect_pool_id": redirect_pool_id,
- "redirect_prefix": redirect_prefix,
- "redirect_url": redirect_url,
"tags": tags,
+ "redirect_prefix": redirect_prefix,
+ "redirect_pool_id": redirect_pool_id,
},
l7_policy_replace_params.L7PolicyReplaceParams,
),
@@ -787,30 +1750,127 @@ async def replace(
cast_to=TaskIDList,
)
+ @overload
async def create_and_poll(
self,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REDIRECT_TO_URL"],
listener_id: str,
+ redirect_url: str,
name: str | Omit = omit,
position: int | Omit = omit,
redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @overload
+ async def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ listener_id: str,
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @overload
+ async def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_POOL"],
+ listener_id: str,
+ redirect_pool_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @overload
+ async def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REJECT"],
+ listener_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Create L7 policy and poll for completion."""
+ ...
+
+ @required_args(
+ ["action", "listener_id", "redirect_url"],
+ ["action", "listener_id", "redirect_prefix"],
+ ["action", "listener_id", "redirect_pool_id"],
+ ["action", "listener_id"],
+ )
+ async def create_and_poll(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
+ listener_id: str,
redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
polling_interval_seconds: int | Omit = omit,
polling_timeout_seconds: int | Omit = omit,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
) -> LoadBalancerL7Policy:
- response = await self.create(
+ """Create L7 policy and poll for completion."""
+ response: TaskIDList = await self.create( # type: ignore
project_id=project_id,
region_id=region_id,
action=action,
@@ -827,10 +1887,10 @@ async def create_and_poll(
extra_body=extra_body,
timeout=timeout,
)
- if not response.tasks or len(response.tasks) != 1:
+ if not response.tasks or len(response.tasks) != 1: # type: ignore[union-attr]
raise ValueError(f"Expected exactly one task to be created")
task = await self._client.cloud.tasks.poll(
- task_id=response.tasks[0],
+ task_id=response.tasks[0], # type: ignore[index]
extra_headers=extra_headers,
polling_interval_seconds=polling_interval_seconds,
polling_timeout_seconds=polling_timeout_seconds,
@@ -882,30 +1942,124 @@ async def delete_and_poll(
polling_timeout_seconds=polling_timeout_seconds,
)
+ @overload
async def replace_and_poll(
self,
l7policy_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
- action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
+ action: Literal["REDIRECT_TO_URL"],
+ redirect_url: str,
name: str | Omit = omit,
position: int | Omit = omit,
redirect_http_code: int | Omit = omit,
- redirect_pool_id: str | Omit = omit,
- redirect_prefix: str | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @overload
+ async def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_PREFIX"],
+ redirect_prefix: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @overload
+ async def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_POOL"],
+ redirect_pool_id: str,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @overload
+ async def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REJECT"],
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ tags: SequenceNotStr[str] | Omit = omit,
+ polling_interval_seconds: int | Omit = omit,
+ polling_timeout_seconds: int | Omit = omit,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ ) -> LoadBalancerL7Policy:
+ """Replace L7 policy and poll for completion."""
+ ...
+
+ @required_args(
+ ["action", "redirect_url"], ["action", "redirect_prefix"], ["action", "redirect_pool_id"], ["action"]
+ )
+ async def replace_and_poll(
+ self,
+ l7policy_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ action: Literal["REDIRECT_TO_URL"]
+ | Literal["REDIRECT_PREFIX"]
+ | Literal["REDIRECT_TO_POOL"]
+ | Literal["REJECT"],
redirect_url: str | Omit = omit,
+ name: str | Omit = omit,
+ position: int | Omit = omit,
+ redirect_http_code: int | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
+ redirect_prefix: str | Omit = omit,
+ redirect_pool_id: str | Omit = omit,
polling_interval_seconds: int | Omit = omit,
polling_timeout_seconds: int | Omit = omit,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
) -> LoadBalancerL7Policy:
- response = await self.replace(
+ """Replace L7 policy and poll for completion."""
+ response: TaskIDList = await self.replace( # type: ignore
l7policy_id=l7policy_id,
project_id=project_id,
region_id=region_id,
@@ -922,10 +2076,10 @@ async def replace_and_poll(
extra_body=extra_body,
timeout=timeout,
)
- if not response.tasks or len(response.tasks) != 1:
+ if not response.tasks or len(response.tasks) != 1: # type: ignore[union-attr]
raise ValueError(f"Expected exactly one task to be created")
await self._client.cloud.tasks.poll(
- task_id=response.tasks[0],
+ task_id=response.tasks[0], # type: ignore[index]
extra_headers=extra_headers,
polling_interval_seconds=polling_interval_seconds,
polling_timeout_seconds=polling_timeout_seconds,
diff --git a/src/gcore/resources/cloud/load_balancers/l7_policies/rules.py b/src/gcore/resources/cloud/load_balancers/l7_policies/rules.py
index 844068db..28405ffb 100644
--- a/src/gcore/resources/cloud/load_balancers/l7_policies/rules.py
+++ b/src/gcore/resources/cloud/load_balancers/l7_policies/rules.py
@@ -77,17 +77,21 @@ def create(
Create load balancer L7 rule
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
compare_type: The comparison type for the L7 rule
type: The L7 rule type
- value: The value to use for the comparison. For example, the file type to compare
+ value: The value to use for the comparison
- invert: When true the logic of the rule is inverted. For example, with invert true,
- 'equal to' would become 'not equal to'. Default is false.
+ invert: When true the logic of the rule is inverted.
- key: The key to use for the comparison. For example, the name of the cookie to
- evaluate.
+ key: The key to use for the comparison.
tags: A list of simple strings assigned to the l7 rule
@@ -141,6 +145,12 @@ def list(
List load balancer L7 policy rules
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -181,6 +191,14 @@ def delete(
Delete load balancer L7 rule
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ l7rule_id: L7 rule ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -223,6 +241,14 @@ def get(
Get load balancer L7 rule
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ l7rule_id: L7 rule ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -254,7 +280,7 @@ def replace(
project_id: int | None = None,
region_id: int | None = None,
l7policy_id: str,
- compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"] | Omit = omit,
+ compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
invert: bool | Omit = omit,
key: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
@@ -281,19 +307,25 @@ def replace(
Replace load balancer L7 rule properties
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ l7rule_id: L7 rule ID
+
compare_type: The comparison type for the L7 rule
- invert: When true the logic of the rule is inverted. For example, with invert true,
- 'equal to' would become 'not equal to'. Default is false.
+ invert: When true the logic of the rule is inverted.
- key: The key to use for the comparison. For example, the name of the cookie to
- evaluate.
+ key: The key to use for the comparison.
tags: A list of simple strings assigned to the l7 rule
type: The L7 rule type
- value: The value to use for the comparison. For example, the file type to compare
+ value: The value to use for the comparison
extra_headers: Send extra headers
@@ -552,17 +584,21 @@ async def create(
Create load balancer L7 rule
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
compare_type: The comparison type for the L7 rule
type: The L7 rule type
- value: The value to use for the comparison. For example, the file type to compare
+ value: The value to use for the comparison
- invert: When true the logic of the rule is inverted. For example, with invert true,
- 'equal to' would become 'not equal to'. Default is false.
+ invert: When true the logic of the rule is inverted.
- key: The key to use for the comparison. For example, the name of the cookie to
- evaluate.
+ key: The key to use for the comparison.
tags: A list of simple strings assigned to the l7 rule
@@ -616,6 +652,12 @@ async def list(
List load balancer L7 policy rules
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -656,6 +698,14 @@ async def delete(
Delete load balancer L7 rule
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ l7rule_id: L7 rule ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -698,6 +748,14 @@ async def get(
Get load balancer L7 rule
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ l7rule_id: L7 rule ID
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -729,7 +787,7 @@ async def replace(
project_id: int | None = None,
region_id: int | None = None,
l7policy_id: str,
- compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"] | Omit = omit,
+ compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
invert: bool | Omit = omit,
key: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
@@ -756,19 +814,25 @@ async def replace(
Replace load balancer L7 rule properties
Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ l7policy_id: L7 policy ID
+
+ l7rule_id: L7 rule ID
+
compare_type: The comparison type for the L7 rule
- invert: When true the logic of the rule is inverted. For example, with invert true,
- 'equal to' would become 'not equal to'. Default is false.
+ invert: When true the logic of the rule is inverted.
- key: The key to use for the comparison. For example, the name of the cookie to
- evaluate.
+ key: The key to use for the comparison.
tags: A list of simple strings assigned to the l7 rule
type: The L7 rule type
- value: The value to use for the comparison. For example, the file type to compare
+ value: The value to use for the comparison
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/load_balancers/load_balancers.py b/src/gcore/resources/cloud/load_balancers/load_balancers.py
index aeb5d194..3674e809 100644
--- a/src/gcore/resources/cloud/load_balancers/load_balancers.py
+++ b/src/gcore/resources/cloud/load_balancers/load_balancers.py
@@ -166,9 +166,10 @@ def create(
logging: Logging configuration
- name: Load balancer name
+ name: Load balancer name. Either `name` or `name_template` should be specified.
- name_template: Load balancer name which will be changed by template.
+ name_template: Load balancer name which will be changed by template. Either `name` or
+ `name_template` should be specified.
preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
members. L2 provides best performance, L3 provides less IPs usage. It is taking
@@ -178,9 +179,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
vip_ip_family: IP family for load balancer subnet auto-selection if `vip_network_id` is
specified
@@ -864,9 +866,10 @@ async def create(
logging: Logging configuration
- name: Load balancer name
+ name: Load balancer name. Either `name` or `name_template` should be specified.
- name_template: Load balancer name which will be changed by template.
+ name_template: Load balancer name which will be changed by template. Either `name` or
+ `name_template` should be specified.
preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
members. L2 provides best performance, L3 provides less IPs usage. It is taking
@@ -876,9 +879,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
vip_ip_family: IP family for load balancer subnet auto-selection if `vip_network_id` is
specified
diff --git a/src/gcore/resources/cloud/networks/networks.py b/src/gcore/resources/cloud/networks/networks.py
index 9d4aba78..1eb0f244 100644
--- a/src/gcore/resources/cloud/networks/networks.py
+++ b/src/gcore/resources/cloud/networks/networks.py
@@ -101,9 +101,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type: vlan or vxlan network type is allowed. Default value is vxlan
@@ -532,9 +533,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type: vlan or vxlan network type is allowed. Default value is vxlan
diff --git a/src/gcore/resources/cloud/networks/subnets.py b/src/gcore/resources/cloud/networks/subnets.py
index 4a1a74f8..7c123a14 100644
--- a/src/gcore/resources/cloud/networks/subnets.py
+++ b/src/gcore/resources/cloud/networks/subnets.py
@@ -108,9 +108,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
@@ -572,9 +573,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
extra_headers: Send extra headers
diff --git a/src/gcore/resources/cloud/ssh_keys.py b/src/gcore/resources/cloud/ssh_keys.py
index 061b0876..cd2c058d 100644
--- a/src/gcore/resources/cloud/ssh_keys.py
+++ b/src/gcore/resources/cloud/ssh_keys.py
@@ -154,6 +154,7 @@ def list(
*,
project_id: int | None = None,
limit: int | Omit = omit,
+ name: str | Omit = omit,
offset: int | Omit = omit,
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -171,6 +172,9 @@ def list(
limit: Maximum number of SSH keys to return
+ name: SSH key name. Partial substring match. Example: `name=abc` matches any key
+ containing `abc` in name.
+
offset: Offset for pagination
order_by: Sort order for the SSH keys
@@ -196,6 +200,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
+ "name": name,
"offset": offset,
"order_by": order_by,
},
@@ -418,6 +423,7 @@ def list(
*,
project_id: int | None = None,
limit: int | Omit = omit,
+ name: str | Omit = omit,
offset: int | Omit = omit,
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -435,6 +441,9 @@ def list(
limit: Maximum number of SSH keys to return
+ name: SSH key name. Partial substring match. Example: `name=abc` matches any key
+ containing `abc` in name.
+
offset: Offset for pagination
order_by: Sort order for the SSH keys
@@ -460,6 +469,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
+ "name": name,
"offset": offset,
"order_by": order_by,
},
diff --git a/src/gcore/resources/cloud/volumes.py b/src/gcore/resources/cloud/volumes.py
index e62095fa..bbb9904e 100644
--- a/src/gcore/resources/cloud/volumes.py
+++ b/src/gcore/resources/cloud/volumes.py
@@ -107,9 +107,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Volume type. Defaults to `standard`. If not specified for source `snapshot`,
volume type will be derived from the snapshot volume.
@@ -176,9 +177,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Volume type. Defaults to `standard`. If not specified for source `snapshot`,
volume type will be derived from the snapshot volume.
@@ -241,9 +243,10 @@ def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Volume type. Defaults to `standard`. If not specified for source `snapshot`,
volume type will be derived from the snapshot volume.
@@ -1353,9 +1356,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Volume type. Defaults to `standard`. If not specified for source `snapshot`,
volume type will be derived from the snapshot volume.
@@ -1422,9 +1426,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Volume type. Defaults to `standard`. If not specified for source `snapshot`,
volume type will be derived from the snapshot volume.
@@ -1487,9 +1492,10 @@ async def create(
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
can be associated with a resource, enabling efficient filtering and grouping for
- better organization and management. Some tags are read-only and cannot be
- modified by the user. Tags are also integrated with cost reports, allowing cost
- data to be filtered based on tag keys or values.
+ better organization and management. Both tag keys and values have a maximum
+ length of 255 characters. Some tags are read-only and cannot be modified by the
+ user. Tags are also integrated with cost reports, allowing cost data to be
+ filtered based on tag keys or values.
type_name: Volume type. Defaults to `standard`. If not specified for source `snapshot`,
volume type will be derived from the snapshot volume.
diff --git a/src/gcore/types/cloud/__init__.py b/src/gcore/types/cloud/__init__.py
index e97ac01a..73915dd5 100644
--- a/src/gcore/types/cloud/__init__.py
+++ b/src/gcore/types/cloud/__init__.py
@@ -66,7 +66,7 @@
from .fixed_address_short import FixedAddressShort as FixedAddressShort
from .gpu_virtual_cluster import GPUVirtualCluster as GPUVirtualCluster
from .interface_ip_family import InterfaceIPFamily as InterfaceIPFamily
-from .k8s_cluster_version import K8sClusterVersion as K8sClusterVersion
+from .k8s_cluster_version import K8SClusterVersion as K8SClusterVersion
from .network_list_params import NetworkListParams as NetworkListParams
from .project_list_params import ProjectListParams as ProjectListParams
from .provisioning_status import ProvisioningStatus as ProvisioningStatus
@@ -119,7 +119,7 @@
from .file_share_create_params import FileShareCreateParams as FileShareCreateParams
from .file_share_resize_params import FileShareResizeParams as FileShareResizeParams
from .file_share_update_params import FileShareUpdateParams as FileShareUpdateParams
-from .k8s_cluster_version_list import K8sClusterVersionList as K8sClusterVersionList
+from .k8s_cluster_version_list import K8SClusterVersionList as K8SClusterVersionList
from .load_balancer_get_params import LoadBalancerGetParams as LoadBalancerGetParams
from .load_balancer_statistics import LoadBalancerStatistics as LoadBalancerStatistics
from .floating_ip_assign_params import FloatingIPAssignParams as FloatingIPAssignParams
diff --git a/src/gcore/types/cloud/baremetal/server_create_params.py b/src/gcore/types/cloud/baremetal/server_create_params.py
index fb749577..e477245e 100644
--- a/src/gcore/types/cloud/baremetal/server_create_params.py
+++ b/src/gcore/types/cloud/baremetal/server_create_params.py
@@ -91,10 +91,10 @@ class ServerCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
user_data: str
diff --git a/src/gcore/types/cloud/blackhole_port.py b/src/gcore/types/cloud/blackhole_port.py
index 6b51cf32..8586ddc3 100644
--- a/src/gcore/types/cloud/blackhole_port.py
+++ b/src/gcore/types/cloud/blackhole_port.py
@@ -12,7 +12,10 @@
class BlackholePort(BaseModel):
alarm_end: datetime = FieldInfo(alias="AlarmEnd")
- """A date-time string giving the time that the alarm ended"""
+ """A date-time string giving the time that the alarm ended.
+
+ If not yet ended, time will be given as 0001-01-01T00:00:00Z
+ """
alarm_start: datetime = FieldInfo(alias="AlarmStart")
"""A date-time string giving the time that the alarm started"""
diff --git a/src/gcore/types/cloud/file_share_create_params.py b/src/gcore/types/cloud/file_share_create_params.py
index c1c8624b..718f0055 100644
--- a/src/gcore/types/cloud/file_share_create_params.py
+++ b/src/gcore/types/cloud/file_share_create_params.py
@@ -41,10 +41,10 @@ class CreateStandardFileShareSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["standard"]
@@ -96,10 +96,10 @@ class CreateVastFileShareSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["vast"]
diff --git a/src/gcore/types/cloud/floating_ip_create_params.py b/src/gcore/types/cloud/floating_ip_create_params.py
index 01d7f41b..48cddda9 100644
--- a/src/gcore/types/cloud/floating_ip_create_params.py
+++ b/src/gcore/types/cloud/floating_ip_create_params.py
@@ -31,8 +31,8 @@ class FloatingIPCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/gpu_baremetal_cluster_create_params.py b/src/gcore/types/cloud/gpu_baremetal_cluster_create_params.py
index 7bdf8a8a..faf830e3 100644
--- a/src/gcore/types/cloud/gpu_baremetal_cluster_create_params.py
+++ b/src/gcore/types/cloud/gpu_baremetal_cluster_create_params.py
@@ -46,10 +46,10 @@ class GPUBaremetalClusterCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py b/src/gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py
index c83f5687..4cae77be 100644
--- a/src/gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py
+++ b/src/gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py
@@ -49,8 +49,8 @@ class ImageUploadParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster_create_params.py b/src/gcore/types/cloud/gpu_virtual_cluster_create_params.py
index acf172b3..d0f2f050 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster_create_params.py
+++ b/src/gcore/types/cloud/gpu_virtual_cluster_create_params.py
@@ -46,10 +46,10 @@ class GPUVirtualClusterCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py b/src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py
index c83f5687..4cae77be 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py
+++ b/src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py
@@ -49,8 +49,8 @@ class ImageUploadParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/instance_create_params.py b/src/gcore/types/cloud/instance_create_params.py
index 0362ecb1..0a279d23 100644
--- a/src/gcore/types/cloud/instance_create_params.py
+++ b/src/gcore/types/cloud/instance_create_params.py
@@ -118,10 +118,10 @@ class InstanceCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
user_data: str
@@ -394,10 +394,10 @@ class VolumeCreateInstanceCreateNewVolumeSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
@@ -455,10 +455,10 @@ class VolumeCreateInstanceCreateVolumeFromImageSerializer(TypedDict, total=False
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
@@ -509,10 +509,10 @@ class VolumeCreateInstanceCreateVolumeFromSnapshotSerializer(TypedDict, total=Fa
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["ssd_hiiops", "standard"]
@@ -555,10 +555,10 @@ class VolumeCreateInstanceCreateVolumeFromApptemplateSerializer(TypedDict, total
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
@@ -600,10 +600,10 @@ class VolumeCreateInstanceExistingVolumeSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/instances/image_create_from_volume_params.py b/src/gcore/types/cloud/instances/image_create_from_volume_params.py
index 70dd351f..d98e34ae 100644
--- a/src/gcore/types/cloud/instances/image_create_from_volume_params.py
+++ b/src/gcore/types/cloud/instances/image_create_from_volume_params.py
@@ -44,8 +44,8 @@ class ImageCreateFromVolumeParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/instances/image_update_params.py b/src/gcore/types/cloud/instances/image_update_params.py
index 6676110f..d51c715f 100644
--- a/src/gcore/types/cloud/instances/image_update_params.py
+++ b/src/gcore/types/cloud/instances/image_update_params.py
@@ -36,8 +36,8 @@ class ImageUpdateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/instances/image_upload_params.py b/src/gcore/types/cloud/instances/image_upload_params.py
index 08cfe96f..4085ea54 100644
--- a/src/gcore/types/cloud/instances/image_upload_params.py
+++ b/src/gcore/types/cloud/instances/image_upload_params.py
@@ -53,8 +53,8 @@ class ImageUploadParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/k8s/__init__.py b/src/gcore/types/cloud/k8s/__init__.py
index 2ce45d68..0eed39f3 100644
--- a/src/gcore/types/cloud/k8s/__init__.py
+++ b/src/gcore/types/cloud/k8s/__init__.py
@@ -2,12 +2,12 @@
from __future__ import annotations
-from .k8s_cluster import K8sCluster as K8sCluster
-from .k8s_cluster_list import K8sClusterList as K8sClusterList
+from .k8s_cluster import K8SCluster as K8SCluster
+from .k8s_cluster_list import K8SClusterList as K8SClusterList
from .flavor_list_params import FlavorListParams as FlavorListParams
from .cluster_create_params import ClusterCreateParams as ClusterCreateParams
from .cluster_delete_params import ClusterDeleteParams as ClusterDeleteParams
from .cluster_update_params import ClusterUpdateParams as ClusterUpdateParams
from .cluster_upgrade_params import ClusterUpgradeParams as ClusterUpgradeParams
-from .k8s_cluster_kubeconfig import K8sClusterKubeconfig as K8sClusterKubeconfig
-from .k8s_cluster_certificate import K8sClusterCertificate as K8sClusterCertificate
+from .k8s_cluster_kubeconfig import K8SClusterKubeconfig as K8SClusterKubeconfig
+from .k8s_cluster_certificate import K8SClusterCertificate as K8SClusterCertificate
diff --git a/src/gcore/types/cloud/k8s/cluster_update_params.py b/src/gcore/types/cloud/k8s/cluster_update_params.py
index 46e02a9d..d6b1dd55 100644
--- a/src/gcore/types/cloud/k8s/cluster_update_params.py
+++ b/src/gcore/types/cloud/k8s/cluster_update_params.py
@@ -12,8 +12,8 @@
"ClusterUpdateParams",
"AddOns",
"AddOnsSlurm",
- "AddOnsSlurmK8sClusterSlurmAddonEnableV2Serializer",
- "AddOnsSlurmK8sClusterSlurmAddonDisableV2Serializer",
+ "AddOnsSlurmK8SClusterSlurmAddonEnableV2Serializer",
+ "AddOnsSlurmK8SClusterSlurmAddonDisableV2Serializer",
"Authentication",
"AuthenticationOidc",
"Cni",
@@ -105,7 +105,7 @@ class ClusterUpdateParams(TypedDict, total=False):
"""Logging configuration"""
-class AddOnsSlurmK8sClusterSlurmAddonEnableV2Serializer(TypedDict, total=False):
+class AddOnsSlurmK8SClusterSlurmAddonEnableV2Serializer(TypedDict, total=False):
enabled: Required[Literal[True]]
"""The Slurm add-on will be enabled in the cluster.
@@ -134,13 +134,13 @@ class AddOnsSlurmK8sClusterSlurmAddonEnableV2Serializer(TypedDict, total=False):
"""
-class AddOnsSlurmK8sClusterSlurmAddonDisableV2Serializer(TypedDict, total=False):
+class AddOnsSlurmK8SClusterSlurmAddonDisableV2Serializer(TypedDict, total=False):
enabled: Required[Literal[False]]
"""The Slurm add-on will be disabled in the cluster."""
AddOnsSlurm: TypeAlias = Union[
- AddOnsSlurmK8sClusterSlurmAddonEnableV2Serializer, AddOnsSlurmK8sClusterSlurmAddonDisableV2Serializer
+ AddOnsSlurmK8SClusterSlurmAddonEnableV2Serializer, AddOnsSlurmK8SClusterSlurmAddonDisableV2Serializer
]
diff --git a/src/gcore/types/cloud/k8s/clusters/__init__.py b/src/gcore/types/cloud/k8s/clusters/__init__.py
index 0ffb0b08..e145306b 100644
--- a/src/gcore/types/cloud/k8s/clusters/__init__.py
+++ b/src/gcore/types/cloud/k8s/clusters/__init__.py
@@ -2,9 +2,9 @@
from __future__ import annotations
-from .k8s_cluster_pool import K8sClusterPool as K8sClusterPool
+from .k8s_cluster_pool import K8SClusterPool as K8SClusterPool
from .node_list_params import NodeListParams as NodeListParams
from .pool_create_params import PoolCreateParams as PoolCreateParams
from .pool_resize_params import PoolResizeParams as PoolResizeParams
from .pool_update_params import PoolUpdateParams as PoolUpdateParams
-from .k8s_cluster_pool_list import K8sClusterPoolList as K8sClusterPoolList
+from .k8s_cluster_pool_list import K8SClusterPoolList as K8SClusterPoolList
diff --git a/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py b/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py
index d8aa59e6..415b314c 100644
--- a/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py
+++ b/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py
@@ -4,10 +4,10 @@
from ....._models import BaseModel
-__all__ = ["K8sClusterPool"]
+__all__ = ["K8SClusterPool"]
-class K8sClusterPool(BaseModel):
+class K8SClusterPool(BaseModel):
id: str
"""UUID of the cluster pool"""
diff --git a/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py b/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py
index 9ec5299d..23f3943a 100644
--- a/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py
+++ b/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py
@@ -3,14 +3,14 @@
from typing import List
from ....._models import BaseModel
-from .k8s_cluster_pool import K8sClusterPool
+from .k8s_cluster_pool import K8SClusterPool
-__all__ = ["K8sClusterPoolList"]
+__all__ = ["K8SClusterPoolList"]
-class K8sClusterPoolList(BaseModel):
+class K8SClusterPoolList(BaseModel):
count: int
"""Number of objects"""
- results: List[K8sClusterPool]
+ results: List[K8SClusterPool]
"""Objects"""
diff --git a/src/gcore/types/cloud/k8s/k8s_cluster.py b/src/gcore/types/cloud/k8s/k8s_cluster.py
index a93825fd..8d4e6c21 100644
--- a/src/gcore/types/cloud/k8s/k8s_cluster.py
+++ b/src/gcore/types/cloud/k8s/k8s_cluster.py
@@ -6,10 +6,10 @@
from ..logging import Logging
from ...._models import BaseModel
-from .clusters.k8s_cluster_pool import K8sClusterPool
+from .clusters.k8s_cluster_pool import K8SClusterPool
__all__ = [
- "K8sCluster",
+ "K8SCluster",
"AddOns",
"AddOnsSlurm",
"Csi",
@@ -164,7 +164,7 @@ class DDOSProfile(BaseModel):
"""DDoS profile template name"""
-class K8sCluster(BaseModel):
+class K8SCluster(BaseModel):
id: str
"""Cluster pool uuid"""
@@ -189,7 +189,7 @@ class K8sCluster(BaseModel):
name: str
"""Name"""
- pools: List[K8sClusterPool]
+ pools: List[K8SClusterPool]
"""pools"""
status: Literal["Deleting", "Provisioned", "Provisioning"]
diff --git a/src/gcore/types/cloud/k8s/k8s_cluster_certificate.py b/src/gcore/types/cloud/k8s/k8s_cluster_certificate.py
index c7965b6c..03e30bf1 100644
--- a/src/gcore/types/cloud/k8s/k8s_cluster_certificate.py
+++ b/src/gcore/types/cloud/k8s/k8s_cluster_certificate.py
@@ -2,10 +2,10 @@
from ...._models import BaseModel
-__all__ = ["K8sClusterCertificate"]
+__all__ = ["K8SClusterCertificate"]
-class K8sClusterCertificate(BaseModel):
+class K8SClusterCertificate(BaseModel):
certificate: str
"""Cluster CA certificate"""
diff --git a/src/gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py b/src/gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py
index c7f7426e..717dddc5 100644
--- a/src/gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py
+++ b/src/gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py
@@ -5,10 +5,10 @@
from ...._models import BaseModel
-__all__ = ["K8sClusterKubeconfig"]
+__all__ = ["K8SClusterKubeconfig"]
-class K8sClusterKubeconfig(BaseModel):
+class K8SClusterKubeconfig(BaseModel):
client_certificate: str
"""String in base64 format. Cluster client certificate"""
diff --git a/src/gcore/types/cloud/k8s/k8s_cluster_list.py b/src/gcore/types/cloud/k8s/k8s_cluster_list.py
index b3ed3df7..bc252f6b 100644
--- a/src/gcore/types/cloud/k8s/k8s_cluster_list.py
+++ b/src/gcore/types/cloud/k8s/k8s_cluster_list.py
@@ -3,14 +3,14 @@
from typing import List
from ...._models import BaseModel
-from .k8s_cluster import K8sCluster
+from .k8s_cluster import K8SCluster
-__all__ = ["K8sClusterList"]
+__all__ = ["K8SClusterList"]
-class K8sClusterList(BaseModel):
+class K8SClusterList(BaseModel):
count: int
"""Number of objects"""
- results: List[K8sCluster]
+ results: List[K8SCluster]
"""Objects"""
diff --git a/src/gcore/types/cloud/k8s_cluster_version.py b/src/gcore/types/cloud/k8s_cluster_version.py
index 6f8c1ddf..257cf728 100644
--- a/src/gcore/types/cloud/k8s_cluster_version.py
+++ b/src/gcore/types/cloud/k8s_cluster_version.py
@@ -2,9 +2,9 @@
from ..._models import BaseModel
-__all__ = ["K8sClusterVersion"]
+__all__ = ["K8SClusterVersion"]
-class K8sClusterVersion(BaseModel):
+class K8SClusterVersion(BaseModel):
version: str
"""List of supported Kubernetes cluster versions"""
diff --git a/src/gcore/types/cloud/k8s_cluster_version_list.py b/src/gcore/types/cloud/k8s_cluster_version_list.py
index 27a17073..2f66ffb7 100644
--- a/src/gcore/types/cloud/k8s_cluster_version_list.py
+++ b/src/gcore/types/cloud/k8s_cluster_version_list.py
@@ -3,14 +3,14 @@
from typing import List
from ..._models import BaseModel
-from .k8s_cluster_version import K8sClusterVersion
+from .k8s_cluster_version import K8SClusterVersion
-__all__ = ["K8sClusterVersionList"]
+__all__ = ["K8SClusterVersionList"]
-class K8sClusterVersionList(BaseModel):
+class K8SClusterVersionList(BaseModel):
count: int
"""Number of objects"""
- results: List[K8sClusterVersion]
+ results: List[K8SClusterVersion]
"""Objects"""
diff --git a/src/gcore/types/cloud/load_balancer_create_params.py b/src/gcore/types/cloud/load_balancer_create_params.py
index 28429738..e75028f8 100644
--- a/src/gcore/types/cloud/load_balancer_create_params.py
+++ b/src/gcore/types/cloud/load_balancer_create_params.py
@@ -52,10 +52,13 @@ class LoadBalancerCreateParams(TypedDict, total=False):
"""Logging configuration"""
name: str
- """Load balancer name"""
+ """Load balancer name. Either `name` or `name_template` should be specified."""
name_template: str
- """Load balancer name which will be changed by template."""
+ """Load balancer name which will be changed by template.
+
+ Either `name` or `name_template` should be specified.
+ """
preferred_connectivity: LoadBalancerMemberConnectivity
"""
@@ -70,10 +73,10 @@ class LoadBalancerCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
vip_ip_family: InterfaceIPFamily
diff --git a/src/gcore/types/cloud/load_balancer_l7_policy.py b/src/gcore/types/cloud/load_balancer_l7_policy.py
index 4190b4e9..1619c8f9 100644
--- a/src/gcore/types/cloud/load_balancer_l7_policy.py
+++ b/src/gcore/types/cloud/load_balancer_l7_policy.py
@@ -4,36 +4,49 @@
from typing_extensions import Literal
from ..._models import BaseModel
-from .load_balancer_l7_rule import LoadBalancerL7Rule
+from .provisioning_status import ProvisioningStatus
+from .load_balancer_operating_status import LoadBalancerOperatingStatus
-__all__ = ["LoadBalancerL7Policy"]
+__all__ = ["LoadBalancerL7Policy", "Rule"]
+
+
+class Rule(BaseModel):
+ id: str
+ """L7Rule ID"""
+
+ project_id: int
+ """Project ID"""
+
+ region: str
+ """Region name"""
+
+ region_id: int
+ """Region ID"""
class LoadBalancerL7Policy(BaseModel):
- id: Optional[str] = None
+ id: str
"""ID"""
- action: Optional[Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"]] = None
+ action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"]
"""Action"""
- listener_id: Optional[str] = None
+ listener_id: str
"""Listener ID"""
- name: Optional[str] = None
+ name: str
"""Human-readable name of the policy"""
- operating_status: Optional[Literal["DEGRADED", "DRAINING", "ERROR", "NO_MONITOR", "OFFLINE", "ONLINE"]] = None
+ operating_status: LoadBalancerOperatingStatus
"""L7 policy operating status"""
- position: Optional[int] = None
+ position: int
"""The position of this policy on the listener. Positions start at 1."""
- project_id: Optional[int] = None
+ project_id: int
"""Project ID"""
- provisioning_status: Optional[
- Literal["ACTIVE", "DELETED", "ERROR", "PENDING_CREATE", "PENDING_DELETE", "PENDING_UPDATE"]
- ] = None
+ provisioning_status: ProvisioningStatus
redirect_http_code: Optional[int] = None
"""
@@ -60,13 +73,13 @@ class LoadBalancerL7Policy(BaseModel):
Only valid if action is `REDIRECT_TO_URL`.
"""
- region: Optional[str] = None
+ region: str
"""Region name"""
- region_id: Optional[int] = None
+ region_id: int
"""Region ID"""
- rules: Optional[List[LoadBalancerL7Rule]] = None
+ rules: List[Rule]
"""Rules.
All the rules associated with a given policy are logically ANDed together. A
@@ -75,7 +88,7 @@ class LoadBalancerL7Policy(BaseModel):
policies with the same action.
"""
- tags: Optional[List[str]] = None
+ tags: List[str]
"""A list of simple strings assigned to the resource."""
task_id: Optional[str] = None
diff --git a/src/gcore/types/cloud/load_balancer_l7_policy_list.py b/src/gcore/types/cloud/load_balancer_l7_policy_list.py
index e3fa62c0..b1b156f1 100644
--- a/src/gcore/types/cloud/load_balancer_l7_policy_list.py
+++ b/src/gcore/types/cloud/load_balancer_l7_policy_list.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import List
from ..._models import BaseModel
from .load_balancer_l7_policy import LoadBalancerL7Policy
@@ -9,8 +9,8 @@
class LoadBalancerL7PolicyList(BaseModel):
- count: Optional[int] = None
+ count: int
"""Number of objects"""
- results: Optional[List[LoadBalancerL7Policy]] = None
+ results: List[LoadBalancerL7Policy]
"""Objects"""
diff --git a/src/gcore/types/cloud/load_balancer_l7_rule.py b/src/gcore/types/cloud/load_balancer_l7_rule.py
index 244e294b..4c6b3c5d 100644
--- a/src/gcore/types/cloud/load_balancer_l7_rule.py
+++ b/src/gcore/types/cloud/load_balancer_l7_rule.py
@@ -4,18 +4,20 @@
from typing_extensions import Literal
from ..._models import BaseModel
+from .provisioning_status import ProvisioningStatus
+from .load_balancer_operating_status import LoadBalancerOperatingStatus
__all__ = ["LoadBalancerL7Rule"]
class LoadBalancerL7Rule(BaseModel):
- id: Optional[str] = None
+ id: str
"""L7Rule ID"""
- compare_type: Optional[Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"]] = None
+ compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"]
"""The comparison type for the L7 rule"""
- invert: Optional[bool] = None
+ invert: bool
"""When true the logic of the rule is inverted.
For example, with invert true, 'equal to' would become 'not equal to'. Default
@@ -28,20 +30,18 @@ class LoadBalancerL7Rule(BaseModel):
For example, the name of the cookie to evaluate.
"""
- operating_status: Optional[Literal["DEGRADED", "DRAINING", "ERROR", "NO_MONITOR", "OFFLINE", "ONLINE"]] = None
+ operating_status: LoadBalancerOperatingStatus
"""L7 policy operating status"""
- project_id: Optional[int] = None
+ project_id: int
"""Project ID"""
- provisioning_status: Optional[
- Literal["ACTIVE", "DELETED", "ERROR", "PENDING_CREATE", "PENDING_DELETE", "PENDING_UPDATE"]
- ] = None
+ provisioning_status: ProvisioningStatus
- region: Optional[str] = None
+ region: str
"""Region name"""
- region_id: Optional[int] = None
+ region_id: int
"""Region ID"""
tags: Optional[List[str]] = None
@@ -54,19 +54,10 @@ class LoadBalancerL7Rule(BaseModel):
the resource is not locked.
"""
- type: Optional[
- Literal[
- "COOKIE",
- "FILE_TYPE",
- "HEADER",
- "HOST_NAME",
- "PATH",
- "SSL_CONN_HAS_CERT",
- "SSL_DN_FIELD",
- "SSL_VERIFY_RESULT",
- ]
- ] = None
+ type: Literal[
+ "COOKIE", "FILE_TYPE", "HEADER", "HOST_NAME", "PATH", "SSL_CONN_HAS_CERT", "SSL_DN_FIELD", "SSL_VERIFY_RESULT"
+ ]
"""The L7 rule type"""
- value: Optional[str] = None
+ value: str
"""The value to use for the comparison. For example, the file type to compare."""
diff --git a/src/gcore/types/cloud/load_balancer_l7_rule_list.py b/src/gcore/types/cloud/load_balancer_l7_rule_list.py
index 8bd48ca0..58dee359 100644
--- a/src/gcore/types/cloud/load_balancer_l7_rule_list.py
+++ b/src/gcore/types/cloud/load_balancer_l7_rule_list.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import List
from ..._models import BaseModel
from .load_balancer_l7_rule import LoadBalancerL7Rule
@@ -9,8 +9,8 @@
class LoadBalancerL7RuleList(BaseModel):
- count: Optional[int] = None
+ count: int
"""Number of objects"""
- results: Optional[List[LoadBalancerL7Rule]] = None
+ results: List[LoadBalancerL7Rule]
"""Objects"""
diff --git a/src/gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py b/src/gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py
index a15d72e2..30ab9c53 100644
--- a/src/gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py
+++ b/src/gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py
@@ -11,8 +11,10 @@
class RuleCreateParams(TypedDict, total=False):
project_id: int
+ """Project ID"""
region_id: int
+ """Region ID"""
compare_type: Required[Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"]]
"""The comparison type for the L7 rule"""
@@ -32,20 +34,13 @@ class RuleCreateParams(TypedDict, total=False):
"""The L7 rule type"""
value: Required[str]
- """The value to use for the comparison. For example, the file type to compare"""
+ """The value to use for the comparison"""
invert: bool
- """When true the logic of the rule is inverted.
-
- For example, with invert true, 'equal to' would become 'not equal to'. Default
- is false.
- """
+ """When true the logic of the rule is inverted."""
key: str
- """The key to use for the comparison.
-
- For example, the name of the cookie to evaluate.
- """
+ """The key to use for the comparison."""
tags: SequenceNotStr[str]
"""A list of simple strings assigned to the l7 rule"""
diff --git a/src/gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py b/src/gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py
index 4694d1b8..0d8e5c97 100644
--- a/src/gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py
+++ b/src/gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py
@@ -11,26 +11,22 @@
class RuleReplaceParams(TypedDict, total=False):
project_id: int
+ """Project ID"""
region_id: int
+ """Region ID"""
l7policy_id: Required[str]
+ """L7 policy ID"""
- compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"]
+ compare_type: Required[Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"]]
"""The comparison type for the L7 rule"""
invert: bool
- """When true the logic of the rule is inverted.
-
- For example, with invert true, 'equal to' would become 'not equal to'. Default
- is false.
- """
+ """When true the logic of the rule is inverted."""
key: str
- """The key to use for the comparison.
-
- For example, the name of the cookie to evaluate.
- """
+ """The key to use for the comparison."""
tags: SequenceNotStr[str]
"""A list of simple strings assigned to the l7 rule"""
@@ -41,4 +37,4 @@ class RuleReplaceParams(TypedDict, total=False):
"""The L7 rule type"""
value: str
- """The value to use for the comparison. For example, the file type to compare"""
+ """The value to use for the comparison"""
diff --git a/src/gcore/types/cloud/load_balancers/l7_policy_create_params.py b/src/gcore/types/cloud/load_balancers/l7_policy_create_params.py
index 2ffea9c0..1ab01e3f 100644
--- a/src/gcore/types/cloud/load_balancers/l7_policy_create_params.py
+++ b/src/gcore/types/cloud/load_balancers/l7_policy_create_params.py
@@ -2,54 +2,138 @@
from __future__ import annotations
-from typing_extensions import Literal, Required, TypedDict
+from typing import Union
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
from ...._types import SequenceNotStr
-__all__ = ["L7PolicyCreateParams"]
+__all__ = [
+ "L7PolicyCreateParams",
+ "CreateL7PolicyRedirectToURLSerializer",
+ "CreateL7PolicyRedirectPrefixSerializer",
+ "CreateL7PolicyRedirectToPoolSerializer",
+ "CreateL7PolicyRejectSerializer",
+]
-class L7PolicyCreateParams(TypedDict, total=False):
+class CreateL7PolicyRedirectToURLSerializer(TypedDict, total=False):
project_id: int
+ """Project ID"""
region_id: int
+ """Region ID"""
- action: Required[Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"]]
+ action: Required[Literal["REDIRECT_TO_URL"]]
"""Action"""
listener_id: Required[str]
"""Listener ID"""
+ redirect_url: Required[str]
+ """Requests matching this policy will be redirected to this URL."""
+
name: str
"""Human-readable name of the policy"""
position: int
- """The position of this policy on the listener. Positions start at 1."""
+ """The position of this policy on the listener"""
redirect_http_code: int
"""
Requests matching this policy will be redirected to the specified URL or Prefix
- URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
- `REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
"""
- redirect_pool_id: str
- """Requests matching this policy will be redirected to the pool withthis ID.
+ tags: SequenceNotStr[str]
+ """A list of simple strings assigned to the resource."""
- Only valid if action is `REDIRECT_TO_POOL`.
- """
- redirect_prefix: str
- """Requests matching this policy will be redirected to this Prefix URL.
+class CreateL7PolicyRedirectPrefixSerializer(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
- Only valid if action is `REDIRECT_PREFIX`.
- """
+ region_id: int
+ """Region ID"""
+
+ action: Required[Literal["REDIRECT_PREFIX"]]
+ """Action"""
+
+ listener_id: Required[str]
+ """Listener ID"""
+
+ redirect_prefix: Required[str]
+ """Requests matching this policy will be redirected to this Prefix URL."""
+
+ name: str
+ """Human-readable name of the policy"""
- redirect_url: str
- """Requests matching this policy will be redirected to this URL.
+ position: int
+ """The position of this policy on the listener"""
- Only valid if action is `REDIRECT_TO_URL`.
+ redirect_http_code: int
+ """
+ Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
"""
tags: SequenceNotStr[str]
"""A list of simple strings assigned to the resource."""
+
+
+class CreateL7PolicyRedirectToPoolSerializer(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
+
+ region_id: int
+ """Region ID"""
+
+ action: Required[Literal["REDIRECT_TO_POOL"]]
+ """Action"""
+
+ listener_id: Required[str]
+ """Listener ID"""
+
+ redirect_pool_id: Required[str]
+ """Requests matching this policy will be redirected to the pool with this ID."""
+
+ name: str
+ """Human-readable name of the policy"""
+
+ position: int
+ """The position of this policy on the listener"""
+
+ tags: SequenceNotStr[str]
+ """A list of simple strings assigned to the resource."""
+
+
+class CreateL7PolicyRejectSerializer(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
+
+ region_id: int
+ """Region ID"""
+
+ action: Required[Literal["REJECT"]]
+ """Action"""
+
+ listener_id: Required[str]
+ """Listener ID"""
+
+ name: str
+ """Human-readable name of the policy"""
+
+ position: int
+ """The position of this policy on the listener"""
+
+ tags: SequenceNotStr[str]
+ """A list of simple strings assigned to the resource."""
+
+
+L7PolicyCreateParams: TypeAlias = Union[
+ CreateL7PolicyRedirectToURLSerializer,
+ CreateL7PolicyRedirectPrefixSerializer,
+ CreateL7PolicyRedirectToPoolSerializer,
+ CreateL7PolicyRejectSerializer,
+]
diff --git a/src/gcore/types/cloud/load_balancers/l7_policy_replace_params.py b/src/gcore/types/cloud/load_balancers/l7_policy_replace_params.py
index 2ed23ebc..806e90ac 100644
--- a/src/gcore/types/cloud/load_balancers/l7_policy_replace_params.py
+++ b/src/gcore/types/cloud/load_balancers/l7_policy_replace_params.py
@@ -2,26 +2,41 @@
from __future__ import annotations
-from typing_extensions import Literal, Required, TypedDict
+from typing import Union
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
from ...._types import SequenceNotStr
-__all__ = ["L7PolicyReplaceParams"]
+__all__ = [
+ "L7PolicyReplaceParams",
+ "UpdateL7PolicyRedirectToURLSerializer",
+ "UpdateL7PolicyRedirectPrefixSerializer",
+ "UpdateL7PolicyRedirectToPoolSerializer",
+ "UpdateL7PolicyRejectSerializer",
+]
-class L7PolicyReplaceParams(TypedDict, total=False):
+class UpdateL7PolicyRedirectToURLSerializer(TypedDict, total=False):
project_id: int
+ """Project ID"""
region_id: int
+ """Region ID"""
- action: Required[Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"]]
+ action: Required[Literal["REDIRECT_TO_URL"]]
"""Action"""
+ redirect_url: Required[str]
+ """Requests matching this policy will be redirected to this URL.
+
+ Only valid if action is `REDIRECT_TO_URL`.
+ """
+
name: str
"""Human-readable name of the policy"""
position: int
- """The position of this policy on the listener. Positions start at 1."""
+ """The position of this policy on the listener"""
redirect_http_code: int
"""
@@ -30,23 +45,86 @@ class L7PolicyReplaceParams(TypedDict, total=False):
`REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
"""
- redirect_pool_id: str
- """Requests matching this policy will be redirected to the pool with this ID.
+ tags: SequenceNotStr[str]
+ """A list of simple strings assigned to the resource."""
- Only valid if action is `REDIRECT_TO_POOL`.
- """
- redirect_prefix: str
- """Requests matching this policy will be redirected to this Prefix URL.
+class UpdateL7PolicyRedirectPrefixSerializer(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
- Only valid if action is `REDIRECT_PREFIX`.
- """
+ region_id: int
+ """Region ID"""
- redirect_url: str
- """Requests matching this policy will be redirected to this URL.
+ action: Required[Literal["REDIRECT_PREFIX"]]
+ """Action"""
- Only valid if action is `REDIRECT_TO_URL`.
+ redirect_prefix: Required[str]
+ """Requests matching this policy will be redirected to this Prefix URL."""
+
+ name: str
+ """Human-readable name of the policy"""
+
+ position: int
+ """The position of this policy on the listener"""
+
+ redirect_http_code: int
"""
+ Requests matching this policy will be redirected to the specified URL or Prefix
+ URL with the HTTP response code. Valid options are 301, 302, 303, 307, or 308.
+ Default is 302.
+ """
+
+ tags: SequenceNotStr[str]
+ """A list of simple strings assigned to the resource."""
+
+
+class UpdateL7PolicyRedirectToPoolSerializer(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
+
+ region_id: int
+ """Region ID"""
+
+ action: Required[Literal["REDIRECT_TO_POOL"]]
+ """Action"""
+
+ redirect_pool_id: Required[str]
+ """Requests matching this policy will be redirected to the pool with this ID."""
+
+ name: str
+ """Human-readable name of the policy"""
+
+ position: int
+ """The position of this policy on the listener"""
+
+ tags: SequenceNotStr[str]
+ """A list of simple strings assigned to the resource."""
+
+
+class UpdateL7PolicyRejectSerializer(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
+
+ region_id: int
+ """Region ID"""
+
+ action: Required[Literal["REJECT"]]
+ """Action"""
+
+ name: str
+ """Human-readable name of the policy"""
+
+ position: int
+ """The position of this policy on the listener"""
tags: SequenceNotStr[str]
"""A list of simple strings assigned to the resource."""
+
+
+L7PolicyReplaceParams: TypeAlias = Union[
+ UpdateL7PolicyRedirectToURLSerializer,
+ UpdateL7PolicyRedirectPrefixSerializer,
+ UpdateL7PolicyRedirectToPoolSerializer,
+ UpdateL7PolicyRejectSerializer,
+]
diff --git a/src/gcore/types/cloud/network_create_params.py b/src/gcore/types/cloud/network_create_params.py
index da45b25c..b4cb5e77 100644
--- a/src/gcore/types/cloud/network_create_params.py
+++ b/src/gcore/types/cloud/network_create_params.py
@@ -25,10 +25,10 @@ class NetworkCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type: Literal["vlan", "vxlan"]
diff --git a/src/gcore/types/cloud/networks/subnet_create_params.py b/src/gcore/types/cloud/networks/subnet_create_params.py
index 6d8b3749..5a6b365f 100644
--- a/src/gcore/types/cloud/networks/subnet_create_params.py
+++ b/src/gcore/types/cloud/networks/subnet_create_params.py
@@ -64,10 +64,10 @@ class SubnetCreateParams(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/security_group_create_params.py b/src/gcore/types/cloud/security_group_create_params.py
index 4721a5dc..35527106 100644
--- a/src/gcore/types/cloud/security_group_create_params.py
+++ b/src/gcore/types/cloud/security_group_create_params.py
@@ -85,12 +85,12 @@ class SecurityGroup(TypedDict, total=False):
security_group_rules: Iterable[SecurityGroupSecurityGroupRule]
"""Security group rules"""
- tags: Dict[str, object]
+ tags: Dict[str, str]
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
diff --git a/src/gcore/types/cloud/ssh_key_list_params.py b/src/gcore/types/cloud/ssh_key_list_params.py
index a3dea48f..6082d012 100644
--- a/src/gcore/types/cloud/ssh_key_list_params.py
+++ b/src/gcore/types/cloud/ssh_key_list_params.py
@@ -14,6 +14,13 @@ class SSHKeyListParams(TypedDict, total=False):
limit: int
"""Maximum number of SSH keys to return"""
+ name: str
+ """SSH key name.
+
+ Partial substring match. Example: `name=abc` matches any key containing `abc` in
+ name.
+ """
+
offset: int
"""Offset for pagination"""
diff --git a/src/gcore/types/cloud/tag.py b/src/gcore/types/cloud/tag.py
index bf23a3ce..e53068dc 100644
--- a/src/gcore/types/cloud/tag.py
+++ b/src/gcore/types/cloud/tag.py
@@ -7,10 +7,10 @@
class Tag(BaseModel):
key: str
- """Tag key. The maximum size for a key is 255 bytes."""
+ """Tag key. The maximum size for a key is 255 characters."""
read_only: bool
"""If true, the tag is read-only and cannot be modified by the user"""
value: str
- """Tag value. The maximum size for a value is 1024 bytes."""
+ """Tag value. The maximum size for a value is 255 characters."""
diff --git a/src/gcore/types/cloud/volume_create_params.py b/src/gcore/types/cloud/volume_create_params.py
index 49b57128..2e2dd5a7 100644
--- a/src/gcore/types/cloud/volume_create_params.py
+++ b/src/gcore/types/cloud/volume_create_params.py
@@ -53,10 +53,10 @@ class CreateVolumeFromImageSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
@@ -108,10 +108,10 @@ class CreateVolumeFromSnapshotSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
@@ -157,10 +157,10 @@ class CreateNewVolumeSerializer(TypedDict, total=False):
"""Key-value tags to associate with the resource.
A tag is a key-value pair that can be associated with a resource, enabling
- efficient filtering and grouping for better organization and management. Some
- tags are read-only and cannot be modified by the user. Tags are also integrated
- with cost reports, allowing cost data to be filtered based on tag keys or
- values.
+ efficient filtering and grouping for better organization and management. Both
+ tag keys and values have a maximum length of 255 characters. Some tags are
+ read-only and cannot be modified by the user. Tags are also integrated with cost
+ reports, allowing cost data to be filtered based on tag keys or values.
"""
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
diff --git a/src/gcore/types/iam/api_token_create.py b/src/gcore/types/iam/api_token_create.py
index 5cfc280a..d2157ce0 100644
--- a/src/gcore/types/iam/api_token_create.py
+++ b/src/gcore/types/iam/api_token_create.py
@@ -1,15 +1,84 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
+from typing_extensions import Literal
from ..._models import BaseModel
-__all__ = ["APITokenCreate"]
+__all__ = ["APITokenCreate", "ClientUser", "ClientUserRole"]
+
+
+class ClientUserRole(BaseModel):
+ id: Optional[int] = None
+ """Group's ID: Possible values are:
+
+ - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
+ (API+Web)* 3022 - Purge and Prefetch only (API)
+ """
+
+ name: Optional[
+ Literal[
+ "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)", "Purge and Prefetch only (API+Web)"
+ ]
+ ] = None
+ """Group's name."""
+
+
+class ClientUser(BaseModel):
+ client_id: int
+ """Account's ID."""
+
+ deleted: bool
+ """Deletion flag. If true, then the API token was deleted."""
+
+ role: ClientUserRole
+
+ user_email: str
+ """User's email who issued the API token."""
+
+ user_id: int
+ """User's ID who issued the API token."""
+
+ user_name: str
+ """User's name who issued the API token."""
class APITokenCreate(BaseModel):
+ id: int
+ """API token ID."""
+
+ client_user: ClientUser
+
+ created: str
+ """Date when the API token was issued (ISO 8086/RFC 3339 format), UTC."""
+
+ deleted: bool
+ """Deletion flag. If true, then the API token was deleted."""
+
+ exp_date: Optional[str] = None
+ """
+ Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
+ null, then the API token will never expire.
+ """
+
+ expired: bool
+ """Expiration flag.
+
+ If true, then the API token has expired. When an API token expires it will be
+ automatically deleted.
+ """
+
+ last_usage: str
+ """Date when the API token was last used (ISO 8086/RFC 3339 format), UTC."""
+
+ name: str
+ """API token name."""
+
token: Optional[str] = None
"""
API token. Copy it, because you will not be able to get it again. We do not
store tokens. All responsibility for token storage and usage is on the issuer.
"""
+
+ description: Optional[str] = None
+ """API token description."""
diff --git a/tests/api_resources/cloud/k8s/clusters/test_pools.py b/tests/api_resources/cloud/k8s/clusters/test_pools.py
index e8e7e5b8..214fa14e 100644
--- a/tests/api_resources/cloud/k8s/clusters/test_pools.py
+++ b/tests/api_resources/cloud/k8s/clusters/test_pools.py
@@ -11,8 +11,8 @@
from tests.utils import assert_matches_type
from gcore.types.cloud import TaskIDList
from gcore.types.cloud.k8s.clusters import (
- K8sClusterPool,
- K8sClusterPoolList,
+ K8SClusterPool,
+ K8SClusterPoolList,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -109,7 +109,7 @@ def test_method_update(self, client: Gcore) -> None:
region_id=0,
cluster_name="cluster_name",
)
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Gcore) -> None:
@@ -125,7 +125,7 @@ def test_method_update_with_all_params(self, client: Gcore) -> None:
node_count=2,
taints={"my-taint": "bar:NoSchedule"},
)
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
def test_raw_response_update(self, client: Gcore) -> None:
@@ -139,7 +139,7 @@ def test_raw_response_update(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Gcore) -> None:
@@ -153,7 +153,7 @@ def test_streaming_response_update(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -182,7 +182,7 @@ def test_method_list(self, client: Gcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterPoolList, pool, path=["response"])
+ assert_matches_type(K8SClusterPoolList, pool, path=["response"])
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
@@ -195,7 +195,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = response.parse()
- assert_matches_type(K8sClusterPoolList, pool, path=["response"])
+ assert_matches_type(K8SClusterPoolList, pool, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
@@ -208,7 +208,7 @@ def test_streaming_response_list(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = response.parse()
- assert_matches_type(K8sClusterPoolList, pool, path=["response"])
+ assert_matches_type(K8SClusterPoolList, pool, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -287,7 +287,7 @@ def test_method_get(self, client: Gcore) -> None:
region_id=0,
cluster_name="cluster_name",
)
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
def test_raw_response_get(self, client: Gcore) -> None:
@@ -301,7 +301,7 @@ def test_raw_response_get(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Gcore) -> None:
@@ -315,7 +315,7 @@ def test_streaming_response_get(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -494,7 +494,7 @@ async def test_method_update(self, async_client: AsyncGcore) -> None:
region_id=0,
cluster_name="cluster_name",
)
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncGcore) -> None:
@@ -510,7 +510,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGcore) ->
node_count=2,
taints={"my-taint": "bar:NoSchedule"},
)
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncGcore) -> None:
@@ -524,7 +524,7 @@ async def test_raw_response_update(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = await response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncGcore) -> None:
@@ -538,7 +538,7 @@ async def test_streaming_response_update(self, async_client: AsyncGcore) -> None
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = await response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -567,7 +567,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterPoolList, pool, path=["response"])
+ assert_matches_type(K8SClusterPoolList, pool, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@@ -580,7 +580,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = await response.parse()
- assert_matches_type(K8sClusterPoolList, pool, path=["response"])
+ assert_matches_type(K8SClusterPoolList, pool, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@@ -593,7 +593,7 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = await response.parse()
- assert_matches_type(K8sClusterPoolList, pool, path=["response"])
+ assert_matches_type(K8SClusterPoolList, pool, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -672,7 +672,7 @@ async def test_method_get(self, async_client: AsyncGcore) -> None:
region_id=0,
cluster_name="cluster_name",
)
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
@@ -686,7 +686,7 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = await response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
@@ -700,7 +700,7 @@ async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
pool = await response.parse()
- assert_matches_type(K8sClusterPool, pool, path=["response"])
+ assert_matches_type(K8SClusterPool, pool, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/cloud/k8s/test_clusters.py b/tests/api_resources/cloud/k8s/test_clusters.py
index 800f7316..d9296b23 100644
--- a/tests/api_resources/cloud/k8s/test_clusters.py
+++ b/tests/api_resources/cloud/k8s/test_clusters.py
@@ -9,12 +9,12 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
-from gcore.types.cloud import TaskIDList, K8sClusterVersionList
+from gcore.types.cloud import TaskIDList, K8SClusterVersionList
from gcore.types.cloud.k8s import (
- K8sCluster,
- K8sClusterList,
- K8sClusterKubeconfig,
- K8sClusterCertificate,
+ K8SCluster,
+ K8SClusterList,
+ K8SClusterKubeconfig,
+ K8SClusterCertificate,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -290,7 +290,7 @@ def test_method_list(self, client: Gcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterList, cluster, path=["response"])
+ assert_matches_type(K8SClusterList, cluster, path=["response"])
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
@@ -302,7 +302,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterList, cluster, path=["response"])
+ assert_matches_type(K8SClusterList, cluster, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
@@ -314,7 +314,7 @@ def test_streaming_response_list(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterList, cluster, path=["response"])
+ assert_matches_type(K8SClusterList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -381,7 +381,7 @@ def test_method_get(self, client: Gcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sCluster, cluster, path=["response"])
+ assert_matches_type(K8SCluster, cluster, path=["response"])
@parametrize
def test_raw_response_get(self, client: Gcore) -> None:
@@ -394,7 +394,7 @@ def test_raw_response_get(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sCluster, cluster, path=["response"])
+ assert_matches_type(K8SCluster, cluster, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Gcore) -> None:
@@ -407,7 +407,7 @@ def test_streaming_response_get(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sCluster, cluster, path=["response"])
+ assert_matches_type(K8SCluster, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -427,7 +427,7 @@ def test_method_get_certificate(self, client: Gcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterCertificate, cluster, path=["response"])
+ assert_matches_type(K8SClusterCertificate, cluster, path=["response"])
@parametrize
def test_raw_response_get_certificate(self, client: Gcore) -> None:
@@ -440,7 +440,7 @@ def test_raw_response_get_certificate(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterCertificate, cluster, path=["response"])
+ assert_matches_type(K8SClusterCertificate, cluster, path=["response"])
@parametrize
def test_streaming_response_get_certificate(self, client: Gcore) -> None:
@@ -453,7 +453,7 @@ def test_streaming_response_get_certificate(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterCertificate, cluster, path=["response"])
+ assert_matches_type(K8SClusterCertificate, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -473,7 +473,7 @@ def test_method_get_kubeconfig(self, client: Gcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterKubeconfig, cluster, path=["response"])
+ assert_matches_type(K8SClusterKubeconfig, cluster, path=["response"])
@parametrize
def test_raw_response_get_kubeconfig(self, client: Gcore) -> None:
@@ -486,7 +486,7 @@ def test_raw_response_get_kubeconfig(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterKubeconfig, cluster, path=["response"])
+ assert_matches_type(K8SClusterKubeconfig, cluster, path=["response"])
@parametrize
def test_streaming_response_get_kubeconfig(self, client: Gcore) -> None:
@@ -499,7 +499,7 @@ def test_streaming_response_get_kubeconfig(self, client: Gcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterKubeconfig, cluster, path=["response"])
+ assert_matches_type(K8SClusterKubeconfig, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -519,7 +519,7 @@ def test_method_list_versions_for_upgrade(self, client: Gcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterVersionList, cluster, path=["response"])
+ assert_matches_type(K8SClusterVersionList, cluster, path=["response"])
@parametrize
def test_raw_response_list_versions_for_upgrade(self, client: Gcore) -> None:
@@ -532,7 +532,7 @@ def test_raw_response_list_versions_for_upgrade(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterVersionList, cluster, path=["response"])
+ assert_matches_type(K8SClusterVersionList, cluster, path=["response"])
@parametrize
def test_streaming_response_list_versions_for_upgrade(self, client: Gcore) -> None:
@@ -545,7 +545,7 @@ def test_streaming_response_list_versions_for_upgrade(self, client: Gcore) -> No
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = response.parse()
- assert_matches_type(K8sClusterVersionList, cluster, path=["response"])
+ assert_matches_type(K8SClusterVersionList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -881,7 +881,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterList, cluster, path=["response"])
+ assert_matches_type(K8SClusterList, cluster, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@@ -893,7 +893,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterList, cluster, path=["response"])
+ assert_matches_type(K8SClusterList, cluster, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@@ -905,7 +905,7 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterList, cluster, path=["response"])
+ assert_matches_type(K8SClusterList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -972,7 +972,7 @@ async def test_method_get(self, async_client: AsyncGcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sCluster, cluster, path=["response"])
+ assert_matches_type(K8SCluster, cluster, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
@@ -985,7 +985,7 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sCluster, cluster, path=["response"])
+ assert_matches_type(K8SCluster, cluster, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
@@ -998,7 +998,7 @@ async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sCluster, cluster, path=["response"])
+ assert_matches_type(K8SCluster, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -1018,7 +1018,7 @@ async def test_method_get_certificate(self, async_client: AsyncGcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterCertificate, cluster, path=["response"])
+ assert_matches_type(K8SClusterCertificate, cluster, path=["response"])
@parametrize
async def test_raw_response_get_certificate(self, async_client: AsyncGcore) -> None:
@@ -1031,7 +1031,7 @@ async def test_raw_response_get_certificate(self, async_client: AsyncGcore) -> N
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterCertificate, cluster, path=["response"])
+ assert_matches_type(K8SClusterCertificate, cluster, path=["response"])
@parametrize
async def test_streaming_response_get_certificate(self, async_client: AsyncGcore) -> None:
@@ -1044,7 +1044,7 @@ async def test_streaming_response_get_certificate(self, async_client: AsyncGcore
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterCertificate, cluster, path=["response"])
+ assert_matches_type(K8SClusterCertificate, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -1064,7 +1064,7 @@ async def test_method_get_kubeconfig(self, async_client: AsyncGcore) -> None:
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterKubeconfig, cluster, path=["response"])
+ assert_matches_type(K8SClusterKubeconfig, cluster, path=["response"])
@parametrize
async def test_raw_response_get_kubeconfig(self, async_client: AsyncGcore) -> None:
@@ -1077,7 +1077,7 @@ async def test_raw_response_get_kubeconfig(self, async_client: AsyncGcore) -> No
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterKubeconfig, cluster, path=["response"])
+ assert_matches_type(K8SClusterKubeconfig, cluster, path=["response"])
@parametrize
async def test_streaming_response_get_kubeconfig(self, async_client: AsyncGcore) -> None:
@@ -1090,7 +1090,7 @@ async def test_streaming_response_get_kubeconfig(self, async_client: AsyncGcore)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterKubeconfig, cluster, path=["response"])
+ assert_matches_type(K8SClusterKubeconfig, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -1110,7 +1110,7 @@ async def test_method_list_versions_for_upgrade(self, async_client: AsyncGcore)
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterVersionList, cluster, path=["response"])
+ assert_matches_type(K8SClusterVersionList, cluster, path=["response"])
@parametrize
async def test_raw_response_list_versions_for_upgrade(self, async_client: AsyncGcore) -> None:
@@ -1123,7 +1123,7 @@ async def test_raw_response_list_versions_for_upgrade(self, async_client: AsyncG
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterVersionList, cluster, path=["response"])
+ assert_matches_type(K8SClusterVersionList, cluster, path=["response"])
@parametrize
async def test_streaming_response_list_versions_for_upgrade(self, async_client: AsyncGcore) -> None:
@@ -1136,7 +1136,7 @@ async def test_streaming_response_list_versions_for_upgrade(self, async_client:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
cluster = await response.parse()
- assert_matches_type(K8sClusterVersionList, cluster, path=["response"])
+ assert_matches_type(K8SClusterVersionList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/cloud/load_balancers/l7_policies/test_rules.py b/tests/api_resources/cloud/load_balancers/l7_policies/test_rules.py
index 3d55c8a0..bb3a27f2 100644
--- a/tests/api_resources/cloud/load_balancers/l7_policies/test_rules.py
+++ b/tests/api_resources/cloud/load_balancers/l7_policies/test_rules.py
@@ -20,9 +20,9 @@ class TestRules:
@parametrize
def test_method_create(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -32,24 +32,24 @@ def test_method_create(self, client: Gcore) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
- invert=False,
- key="key",
- tags=["test_tag"],
+ invert=True,
+ key="the name of the cookie to evaluate.",
+ tags=["test_tag_1", "test_tag_2"],
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
def test_raw_response_create(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.rules.with_raw_response.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -63,9 +63,9 @@ def test_raw_response_create(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_create(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.rules.with_streaming_response.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -83,8 +83,8 @@ def test_path_params_create(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.create(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -93,18 +93,18 @@ def test_path_params_create(self, client: Gcore) -> None:
@parametrize
def test_method_list(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.list(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert_matches_type(LoadBalancerL7RuleList, rule, path=["response"])
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.rules.with_raw_response.list(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -115,9 +115,9 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.rules.with_streaming_response.list(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -132,27 +132,27 @@ def test_path_params_list(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.list(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
@parametrize
def test_method_delete(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.rules.with_raw_response.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert response.is_closed is True
@@ -163,10 +163,10 @@ def test_raw_response_delete(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_delete(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.rules.with_streaming_response.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -180,37 +180,37 @@ def test_streaming_response_delete(self, client: Gcore) -> None:
def test_path_params_delete(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
l7policy_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7rule_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.delete(
l7rule_id="",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
@parametrize
def test_method_get(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert_matches_type(LoadBalancerL7Rule, rule, path=["response"])
@parametrize
def test_raw_response_get(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.rules.with_raw_response.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert response.is_closed is True
@@ -221,10 +221,10 @@ def test_raw_response_get(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_get(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.rules.with_streaming_response.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -238,53 +238,55 @@ def test_streaming_response_get(self, client: Gcore) -> None:
def test_path_params_get(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
l7policy_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7rule_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.get(
l7rule_id="",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
@parametrize
def test_method_replace(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
def test_method_replace_with_all_params(self, client: Gcore) -> None:
rule = client.cloud.load_balancers.l7_policies.rules.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
- compare_type="CONTAINS",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
invert=True,
- key="key",
- tags=["string"],
- type="COOKIE",
- value="value",
+ key="the name of the cookie to evaluate.",
+ tags=["test_tag_1", "test_tag_2"],
+ type="PATH",
+ value="/images*",
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
def test_raw_response_replace(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.rules.with_raw_response.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
)
assert response.is_closed is True
@@ -295,10 +297,11 @@ def test_raw_response_replace(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_replace(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.rules.with_streaming_response.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -312,18 +315,20 @@ def test_streaming_response_replace(self, client: Gcore) -> None:
def test_path_params_replace(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
l7policy_id="",
+ compare_type="REGEX",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7rule_id` but received ''"):
client.cloud.load_balancers.l7_policies.rules.with_raw_response.replace(
l7rule_id="",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
)
@@ -335,9 +340,9 @@ class TestAsyncRules:
@parametrize
async def test_method_create(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -347,24 +352,24 @@ async def test_method_create(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
- invert=False,
- key="key",
- tags=["test_tag"],
+ invert=True,
+ key="the name of the cookie to evaluate.",
+ tags=["test_tag_1", "test_tag_2"],
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -378,9 +383,9 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.rules.with_streaming_response.create(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -398,8 +403,8 @@ async def test_path_params_create(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.create(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
compare_type="REGEX",
type="PATH",
value="/images*",
@@ -408,18 +413,18 @@ async def test_path_params_create(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.list(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert_matches_type(LoadBalancerL7RuleList, rule, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.list(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -430,9 +435,9 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.rules.with_streaming_response.list(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -447,27 +452,27 @@ async def test_path_params_list(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.list(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
@parametrize
async def test_method_delete(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert response.is_closed is True
@@ -478,10 +483,10 @@ async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.rules.with_streaming_response.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -495,37 +500,37 @@ async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None
async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.delete(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
l7policy_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7rule_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.delete(
l7rule_id="",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
@parametrize
async def test_method_get(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert_matches_type(LoadBalancerL7Rule, rule, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
assert response.is_closed is True
@@ -536,10 +541,10 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.rules.with_streaming_response.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -553,53 +558,55 @@ async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
async def test_path_params_get(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.get(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
l7policy_id="",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7rule_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.get(
l7rule_id="",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
@parametrize
async def test_method_replace(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
async def test_method_replace_with_all_params(self, async_client: AsyncGcore) -> None:
rule = await async_client.cloud.load_balancers.l7_policies.rules.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
- compare_type="CONTAINS",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
invert=True,
- key="key",
- tags=["string"],
- type="COOKIE",
- value="value",
+ key="the name of the cookie to evaluate.",
+ tags=["test_tag_1", "test_tag_2"],
+ type="PATH",
+ value="/images*",
)
assert_matches_type(TaskIDList, rule, path=["response"])
@parametrize
async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
)
assert response.is_closed is True
@@ -610,10 +617,11 @@ async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_replace(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.rules.with_streaming_response.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -627,16 +635,18 @@ async def test_streaming_response_replace(self, async_client: AsyncGcore) -> Non
async def test_path_params_replace(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.replace(
- l7rule_id="l7rule_id",
- project_id=0,
- region_id=0,
+ l7rule_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
l7policy_id="",
+ compare_type="REGEX",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7rule_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.rules.with_raw_response.replace(
l7rule_id="",
- project_id=0,
- region_id=0,
- l7policy_id="l7policy_id",
+ project_id=1,
+ region_id=1,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ compare_type="REGEX",
)
diff --git a/tests/api_resources/cloud/load_balancers/test_l7_policies.py b/tests/api_resources/cloud/load_balancers/test_l7_policies.py
index 769aa5f8..5cff8201 100644
--- a/tests/api_resources/cloud/load_balancers/test_l7_policies.py
+++ b/tests/api_resources/cloud/load_balancers/test_l7_policies.py
@@ -18,39 +18,39 @@ class TestL7Policies:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
- def test_method_create(self, client: Gcore) -> None:
+ def test_method_create_overload_1(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- def test_method_create_with_all_params(self, client: Gcore) -> None:
+ def test_method_create_with_all_params_overload_1(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
name="redirect-example.com",
position=1,
redirect_http_code=301,
- redirect_pool_id="redirect_pool_id",
- redirect_prefix="redirect_prefix",
- redirect_url="http://www.example.com",
tags=["test_tag"],
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- def test_raw_response_create(self, client: Gcore) -> None:
+ def test_raw_response_create_overload_1(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.with_raw_response.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
)
assert response.is_closed is True
@@ -59,12 +59,181 @@ def test_raw_response_create(self, client: Gcore) -> None:
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- def test_streaming_response_create(self, client: Gcore) -> None:
+ def test_streaming_response_create_overload_1(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.with_streaming_response.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_create_overload_2(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params_overload_2(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ name="redirect-example.com",
+ position=1,
+ redirect_http_code=301,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_raw_response_create_overload_2(self, client: Gcore) -> None:
+ response = client.cloud.load_balancers.l7_policies.with_raw_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create_overload_2(self, client: Gcore) -> None:
+ with client.cloud.load_balancers.l7_policies.with_streaming_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_create_overload_3(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params_overload_3(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_raw_response_create_overload_3(self, client: Gcore) -> None:
+ response = client.cloud.load_balancers.l7_policies.with_raw_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create_overload_3(self, client: Gcore) -> None:
+ with client.cloud.load_balancers.l7_policies.with_streaming_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_create_overload_4(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params_overload_4(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_raw_response_create_overload_4(self, client: Gcore) -> None:
+ response = client.cloud.load_balancers.l7_policies.with_raw_response.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create_overload_4(self, client: Gcore) -> None:
+ with client.cloud.load_balancers.l7_policies.with_streaming_response.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -77,16 +246,16 @@ def test_streaming_response_create(self, client: Gcore) -> None:
@parametrize
def test_method_list(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.list(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
assert_matches_type(LoadBalancerL7PolicyList, l7_policy, path=["response"])
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.with_raw_response.list(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -97,8 +266,8 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.with_streaming_response.list(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -111,18 +280,18 @@ def test_streaming_response_list(self, client: Gcore) -> None:
@parametrize
def test_method_delete(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.delete(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.with_raw_response.delete(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -133,9 +302,9 @@ def test_raw_response_delete(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_delete(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.with_streaming_response.delete(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -150,25 +319,25 @@ def test_path_params_delete(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.with_raw_response.delete(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
@parametrize
def test_method_get(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.get(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert_matches_type(LoadBalancerL7Policy, l7_policy, path=["response"])
@parametrize
def test_raw_response_get(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.with_raw_response.get(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -179,9 +348,9 @@ def test_raw_response_get(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_get(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.with_streaming_response.get(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -196,44 +365,44 @@ def test_path_params_get(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.with_raw_response.get(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
@parametrize
- def test_method_replace(self, client: Gcore) -> None:
+ def test_method_replace_overload_1(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- def test_method_replace_with_all_params(self, client: Gcore) -> None:
+ def test_method_replace_with_all_params_overload_1(self, client: Gcore) -> None:
l7_policy = client.cloud.load_balancers.l7_policies.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
- name="redirect-images.example.com",
+ redirect_url="https://www.example.com",
+ name="redirect-example.com",
position=1,
redirect_http_code=301,
- redirect_pool_id="redirect_pool_id",
- redirect_prefix="redirect_prefix",
- redirect_url="http://images.example.com",
- tags=["updated_tag"],
+ tags=["test_tag"],
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- def test_raw_response_replace(self, client: Gcore) -> None:
+ def test_raw_response_replace_overload_1(self, client: Gcore) -> None:
response = client.cloud.load_balancers.l7_policies.with_raw_response.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
)
assert response.is_closed is True
@@ -242,12 +411,13 @@ def test_raw_response_replace(self, client: Gcore) -> None:
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- def test_streaming_response_replace(self, client: Gcore) -> None:
+ def test_streaming_response_replace_overload_1(self, client: Gcore) -> None:
with client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -258,13 +428,214 @@ def test_streaming_response_replace(self, client: Gcore) -> None:
assert cast(Any, response.is_closed) is True
@parametrize
- def test_path_params_replace(self, client: Gcore) -> None:
+ def test_path_params_replace_overload_1(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
client.cloud.load_balancers.l7_policies.with_raw_response.replace(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
+ )
+
+ @parametrize
+ def test_method_replace_overload_2(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_method_replace_with_all_params_overload_2(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ name="redirect-example.com",
+ position=1,
+ redirect_http_code=301,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_raw_response_replace_overload_2(self, client: Gcore) -> None:
+ response = client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_streaming_response_replace_overload_2(self, client: Gcore) -> None:
+ with client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_replace_overload_2(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
+ client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ )
+
+ @parametrize
+ def test_method_replace_overload_3(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_method_replace_with_all_params_overload_3(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_raw_response_replace_overload_3(self, client: Gcore) -> None:
+ response = client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_streaming_response_replace_overload_3(self, client: Gcore) -> None:
+ with client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_replace_overload_3(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
+ client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+
+ @parametrize
+ def test_method_replace_overload_4(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_method_replace_with_all_params_overload_4(self, client: Gcore) -> None:
+ l7_policy = client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_raw_response_replace_overload_4(self, client: Gcore) -> None:
+ response = client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ def test_streaming_response_replace_overload_4(self, client: Gcore) -> None:
+ with client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_replace_overload_4(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
+ client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
)
@@ -274,39 +645,39 @@ class TestAsyncL7Policies:
)
@parametrize
- async def test_method_create(self, async_client: AsyncGcore) -> None:
+ async def test_method_create_overload_1(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
+ async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
name="redirect-example.com",
position=1,
redirect_http_code=301,
- redirect_pool_id="redirect_pool_id",
- redirect_prefix="redirect_prefix",
- redirect_url="http://www.example.com",
tags=["test_tag"],
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
+ async def test_raw_response_create_overload_1(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
)
assert response.is_closed is True
@@ -315,12 +686,181 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- async def test_streaming_response_create(self, async_client: AsyncGcore) -> None:
+ async def test_streaming_response_create_overload_1(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.create(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_url="https://www.example.com",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_create_overload_2(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ name="redirect-example.com",
+ position=1,
+ redirect_http_code=301,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create_overload_2(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create_overload_2(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_prefix="/api/v1/policies",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_create_overload_3(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params_overload_3(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create_overload_3(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create_overload_3(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.create(
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_create_overload_4(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params_overload_4(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create_overload_4(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create_overload_4(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.create(
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ listener_id="023f2e34-7806-443b-bfae-16c324569a3d",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -333,16 +873,16 @@ async def test_streaming_response_create(self, async_client: AsyncGcore) -> None
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.list(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
assert_matches_type(LoadBalancerL7PolicyList, l7_policy, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.list(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -353,8 +893,8 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.list(
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -367,18 +907,18 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_delete(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.delete(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.delete(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -389,9 +929,9 @@ async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.delete(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -406,25 +946,25 @@ async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.with_raw_response.delete(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
@parametrize
async def test_method_get(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.get(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert_matches_type(LoadBalancerL7Policy, l7_policy, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.get(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
)
assert response.is_closed is True
@@ -435,9 +975,9 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.get(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -452,44 +992,44 @@ async def test_path_params_get(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.with_raw_response.get(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
)
@parametrize
- async def test_method_replace(self, async_client: AsyncGcore) -> None:
+ async def test_method_replace_overload_1(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- async def test_method_replace_with_all_params(self, async_client: AsyncGcore) -> None:
+ async def test_method_replace_with_all_params_overload_1(self, async_client: AsyncGcore) -> None:
l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
- name="redirect-images.example.com",
+ redirect_url="https://www.example.com",
+ name="redirect-example.com",
position=1,
redirect_http_code=301,
- redirect_pool_id="redirect_pool_id",
- redirect_prefix="redirect_prefix",
- redirect_url="http://images.example.com",
- tags=["updated_tag"],
+ tags=["test_tag"],
)
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
+ async def test_raw_response_replace_overload_1(self, async_client: AsyncGcore) -> None:
response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
)
assert response.is_closed is True
@@ -498,12 +1038,13 @@ async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
assert_matches_type(TaskIDList, l7_policy, path=["response"])
@parametrize
- async def test_streaming_response_replace(self, async_client: AsyncGcore) -> None:
+ async def test_streaming_response_replace_overload_1(self, async_client: AsyncGcore) -> None:
async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
- l7policy_id="l7policy_id",
- project_id=0,
- region_id=0,
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -514,11 +1055,212 @@ async def test_streaming_response_replace(self, async_client: AsyncGcore) -> Non
assert cast(Any, response.is_closed) is True
@parametrize
- async def test_path_params_replace(self, async_client: AsyncGcore) -> None:
+ async def test_path_params_replace_overload_1(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
l7policy_id="",
- project_id=0,
- region_id=0,
+ project_id=1,
+ region_id=1,
action="REDIRECT_TO_URL",
+ redirect_url="https://www.example.com",
+ )
+
+ @parametrize
+ async def test_method_replace_overload_2(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_method_replace_with_all_params_overload_2(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ name="redirect-example.com",
+ position=1,
+ redirect_http_code=301,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_raw_response_replace_overload_2(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_replace_overload_2(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_replace_overload_2(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
+ await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_PREFIX",
+ redirect_prefix="/api/v1/policies",
+ )
+
+ @parametrize
+ async def test_method_replace_overload_3(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_method_replace_with_all_params_overload_3(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_raw_response_replace_overload_3(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_replace_overload_3(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_replace_overload_3(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
+ await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="",
+ project_id=1,
+ region_id=1,
+ action="REDIRECT_TO_POOL",
+ redirect_pool_id="00000000-0000-4000-8000-000000000000",
+ )
+
+ @parametrize
+ async def test_method_replace_overload_4(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_method_replace_with_all_params_overload_4(self, async_client: AsyncGcore) -> None:
+ l7_policy = await async_client.cloud.load_balancers.l7_policies.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ name="redirect-example.com",
+ position=1,
+ tags=["test_tag"],
+ )
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_raw_response_replace_overload_4(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_replace_overload_4(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.load_balancers.l7_policies.with_streaming_response.replace(
+ l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ l7_policy = await response.parse()
+ assert_matches_type(TaskIDList, l7_policy, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_replace_overload_4(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `l7policy_id` but received ''"):
+ await async_client.cloud.load_balancers.l7_policies.with_raw_response.replace(
+ l7policy_id="",
+ project_id=1,
+ region_id=1,
+ action="REJECT",
)
diff --git a/tests/api_resources/cloud/test_k8s.py b/tests/api_resources/cloud/test_k8s.py
index 6bd73971..98602a71 100644
--- a/tests/api_resources/cloud/test_k8s.py
+++ b/tests/api_resources/cloud/test_k8s.py
@@ -9,21 +9,21 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
-from gcore.types.cloud import K8sClusterVersionList
+from gcore.types.cloud import K8SClusterVersionList
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-class TestK8s:
+class TestK8S:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
def test_method_list_versions(self, client: Gcore) -> None:
- k8 = client.cloud.k8s.list_versions(
+ k8s = client.cloud.k8s.list_versions(
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterVersionList, k8, path=["response"])
+ assert_matches_type(K8SClusterVersionList, k8s, path=["response"])
@parametrize
def test_raw_response_list_versions(self, client: Gcore) -> None:
@@ -34,8 +34,8 @@ def test_raw_response_list_versions(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- k8 = response.parse()
- assert_matches_type(K8sClusterVersionList, k8, path=["response"])
+ k8s = response.parse()
+ assert_matches_type(K8SClusterVersionList, k8s, path=["response"])
@parametrize
def test_streaming_response_list_versions(self, client: Gcore) -> None:
@@ -46,24 +46,24 @@ def test_streaming_response_list_versions(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- k8 = response.parse()
- assert_matches_type(K8sClusterVersionList, k8, path=["response"])
+ k8s = response.parse()
+ assert_matches_type(K8SClusterVersionList, k8s, path=["response"])
assert cast(Any, response.is_closed) is True
-class TestAsyncK8s:
+class TestAsyncK8S:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@parametrize
async def test_method_list_versions(self, async_client: AsyncGcore) -> None:
- k8 = await async_client.cloud.k8s.list_versions(
+ k8s = await async_client.cloud.k8s.list_versions(
project_id=0,
region_id=0,
)
- assert_matches_type(K8sClusterVersionList, k8, path=["response"])
+ assert_matches_type(K8SClusterVersionList, k8s, path=["response"])
@parametrize
async def test_raw_response_list_versions(self, async_client: AsyncGcore) -> None:
@@ -74,8 +74,8 @@ async def test_raw_response_list_versions(self, async_client: AsyncGcore) -> Non
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- k8 = await response.parse()
- assert_matches_type(K8sClusterVersionList, k8, path=["response"])
+ k8s = await response.parse()
+ assert_matches_type(K8SClusterVersionList, k8s, path=["response"])
@parametrize
async def test_streaming_response_list_versions(self, async_client: AsyncGcore) -> None:
@@ -86,7 +86,7 @@ async def test_streaming_response_list_versions(self, async_client: AsyncGcore)
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- k8 = await response.parse()
- assert_matches_type(K8sClusterVersionList, k8, path=["response"])
+ k8s = await response.parse()
+ assert_matches_type(K8SClusterVersionList, k8s, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/cloud/test_security_groups.py b/tests/api_resources/cloud/test_security_groups.py
index 24ed373f..d1ca3713 100644
--- a/tests/api_resources/cloud/test_security_groups.py
+++ b/tests/api_resources/cloud/test_security_groups.py
@@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Gcore) -> None:
"remote_ip_prefix": "10.0.0.0/8",
}
],
- "tags": {"my-tag": "bar"},
+ "tags": {"my-tag": "my-tag-value"},
},
instances=["00000000-0000-4000-8000-000000000000"],
)
@@ -423,7 +423,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) ->
"remote_ip_prefix": "10.0.0.0/8",
}
],
- "tags": {"my-tag": "bar"},
+ "tags": {"my-tag": "my-tag-value"},
},
instances=["00000000-0000-4000-8000-000000000000"],
)
diff --git a/tests/api_resources/cloud/test_ssh_keys.py b/tests/api_resources/cloud/test_ssh_keys.py
index e1049f06..14428dbf 100644
--- a/tests/api_resources/cloud/test_ssh_keys.py
+++ b/tests/api_resources/cloud/test_ssh_keys.py
@@ -120,6 +120,7 @@ def test_method_list_with_all_params(self, client: Gcore) -> None:
ssh_key = client.cloud.ssh_keys.list(
project_id=1,
limit=100,
+ name="my-ssh-key",
offset=0,
order_by="created_at.desc",
)
@@ -341,6 +342,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> No
ssh_key = await async_client.cloud.ssh_keys.list(
project_id=1,
limit=100,
+ name="my-ssh-key",
offset=0,
order_by="created_at.desc",
)