Retrieves a list of instance resources (available or all). Provides a comprehensive reference for instance configurations. Function Documentation
Request Syntax:
response = swan_orchestrator.get_instance_resources()
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
available |
Boolean | No | Indicates whether to show only available resources or all resources | True |
Usage Notes:
- When
available
isTrue
, returns only available resources - When
available
isFalse
, returns all resource configurations
Creates a task on SWAN orchestrator with flexible deployment options. Function Documentation
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
wallet_address |
String | Yes | Wallet address associated with the newly created task | - |
instance_type |
String | No | Instance type of hardware configuration | 'C1ae.small' |
region |
String | No | Region of hardware | global |
duration |
Integer | No | Service runtime duration in seconds | 3600 (1 hour) |
app_repo_image |
String | No* | Demo space name. Automatically sets auto_pay to True if used |
- |
job_source_uri |
String | No* | Job source URI for deployment. Overrides app_repo_image and repo_uri |
- |
repo_uri |
String | No* | Repository URI to be deployed | - |
repo_branch |
String | No | Repository branch to be deployed | - |
auto_pay |
Boolean | No | Automatically pays to deploy task | True |
private_key |
String | No** | Wallet's private key | - |
preferred_cp_list |
List | No | List of preferred CP account addresses | - |
ip_whitelist |
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 provided - If
auto_pay
isTrue
, task deployment is automatic - If
auto_pay
isFalse
, manual payment confirmation is required
Retrieves deployment information for a specific task. Function Documentation
Request Syntax:
response = swan_orchestrator.get_deployment_info(task_uuid="string")
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
task_uuid |
String | Yes | Unique identifier of the task | - |
Retrieves the real URL for a specific task.
Request Syntax:
response = swan_orchestrator.get_real_url(task_uuid="string")
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
task_uuid |
String | Yes | Unique identifier of the task | - |
Extends the duration of an existing task. Function Documentation
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
task_uuid |
String | Yes | Unique identifier of the task to extend | - |
duration |
Integer | No | Extension duration in seconds | 0 |
tx_hash |
String | No* | Transaction hash of payment | - |
auto_pay |
Boolean | No | Automatically pays to extend task | True |
private_key |
String | No** | Wallet's private key (required if auto_pay is True ) |
- |
Important Notes:
- If
auto_pay
isFalse
,tx_hash
must be provided - If
auto_pay
isTrue
,private_key
must be provided
Terminates a task and provides a refund based on remaining time. Function Documentation
Request Syntax:
response = swan_orchestrator.terminate_task(task_uuid="string")
Parameters:
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
task_uuid |
String | Yes | Unique identifier of the task | - |