SWAN Orchestrator SDK - Function and Parameter Reference
1. Get Instance Resources
Method: swan_orchestrator.get_instance_resources(**kwargs)
swan_orchestrator.get_instance_resources(**kwargs)
Retrieves a list of instance resources (available or all). Provides a comprehensive reference for instance configurations. Function Documentation
Request Syntax:
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
| Boolean | No | Indicates whether to show only available resources or all resources |
|
Usage Notes:
When
available
isTrue
, returns only available resourcesWhen
available
isFalse
, returns all resource configurations
2. Create Task
Method: swan_orchestrator.create_task(**kwargs)
swan_orchestrator.create_task(**kwargs)
Creates a task on SWAN orchestrator with flexible deployment options. Function Documentation
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
| String | Yes | Wallet address associated with the newly created task | - |
| String | No | Instance type of hardware configuration |
|
| String | No | Region of hardware |
|
| Integer | No | Service runtime duration in seconds | 3600 (1 hour) |
| String | No* | Demo space name. Automatically sets | - |
| String | No* | Job source URI for deployment. Overrides | - |
| String | No* | Repository URI to be deployed | - |
| String | No | Repository branch to be deployed | - |
| Boolean | No | Automatically pays to deploy task |
|
| String | No** | Wallet's private key | - |
| List | No | List of preferred CP account addresses | - |
| List | No | List of IP addresses allowed to access the application | - |
Deployment Priority:
job_source_uri
(Highest priority)app_repo_image
repo_uri
Notes:
At least one of
job_source_uri
,app_repo_image
, orrepo_uri
must be providedIf
auto_pay
isTrue
, task deployment is automaticIf
auto_pay
isFalse
, manual payment confirmation is required
3. Get Deployment Information
Method: swan_orchestrator.get_deployment_info(**kwargs)
swan_orchestrator.get_deployment_info(**kwargs)
Retrieves deployment information for a specific task. Function Documentation
Request Syntax:
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
| String | Yes | Unique identifier of the task | - |
4. Get Real URL
Method: swan_orchestrator.get_real_url(**kwargs)
swan_orchestrator.get_real_url(**kwargs)
Retrieves the real URL for a specific task.
Request Syntax:
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
| String | Yes | Unique identifier of the task | - |
5. Renew Task
Method: swan_orchestrator.renew_task(**kwargs)
swan_orchestrator.renew_task(**kwargs)
Extends the duration of an existing task. Function Documentation
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
| String | Yes | Unique identifier of the task to extend | - |
| Integer | No | Extension duration in seconds | 0 |
| String | No* | Transaction hash of payment | - |
| Boolean | No | Automatically pays to extend task |
|
| String | No** | Wallet's private key (required if | - |
Important Notes:
If
auto_pay
isFalse
,tx_hash
must be providedIf
auto_pay
isTrue
,private_key
must be provided
6. Terminate Task
Method: swan_orchestrator.terminate_task(**kwargs)
swan_orchestrator.terminate_task(**kwargs)
Terminates a task and provides a refund based on remaining time. Function Documentation
Request Syntax:
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
| String | Yes | Unique identifier of the task | - |
Last updated