Swan Chain
  • BULDERS
    • Getting Started
    • DApp Developer
      • Deploying Your First Smart Contract with Remix
      • Interacting with Smart Contract on Swan Chain Using Go
    • App Developer
      • Building Docker Images and Deployment file with LDL
        • Lagrange Definition Language(LDL)
      • Deploying with Swan SDK
      • Store and Retrieve a File with Swan Storage
        • 1. Set up the python-MCS-SDK
        • 2.Create and Manage Buckets
        • 3.Upload Files and Folders
        • 4.Retrieve and Download Files
        • 5.Delete Files and Buckets
    • Node Operator
      • Swan Node Snapshots
    • Market Provider
      • Storage Market
      • AI/ML Orchestrator
        • Decentralized AI Marketplace
        • Connect to Orchestrator
      • Web3 ZK Computing Market
        • ZK Auction Engine
        • Sequencer
        • Contribute zk-UBI-task
          • How to Contribute
        • Example
      • Customized Market Provider
    • Computing Provider
      • Fog Computing Provider(FCP)
        • FCP Setup
        • Migrating FCP to Swan Mainnet
        • FCP Funding Operations Guide
        • FCP FAQ
      • Edge Computing Provider (ECP)
        • ECP Setup
        • ECP Funding Operations Guide
        • ECP FAQ
      • FAQ
    • Storage Provider
      • Storage Auction System
    • Developer Tools
      • Swan SDK
        • Python Swan SDK
          • Special Case: Create ssh login instance
          • SWAN Orchestrator SDK - Function and Parameter Reference
        • Go Swan SDK
          • A Sample Tutorial
      • Swan Console
        • Getting Started
        • Blockchain GPU Task Example
        • Custom Blockchain GPU Task Pools
      • Lagrange
      • Swan IPFS Storage
      • Nebula Block Cloud
      • Ecosystem Projects
    • Mission 3.0
      • Get Started
        • For Users
        • For Space Holders
  • NETWORK REFERENCE
    • Network Info
      • Set Up Your Wallet
      • Bridge Token
    • Contract Addresses
    • Fees
  • Core Concepts
    • Introduction to Swan Chain
    • Consensus Layer
    • Peer-to-peer (P2P) Network
    • Payment Channels
    • Service Discovery
    • Market Provider
      • Storage Market
      • AI Computing Marketplace
        • Orchestrator
        • Auction Engine
        • Bidding Task State Machine
      • ZK Proof Marketplace
        • ZK Task
        • ZK Pool
    • Storage Layer
    • Computing Layer
      • Computing Provider Protocol
      • Computing Provider Account
      • Layer3 Computing Protocol
      • Reputation System
      • Dynamic Pricing
    • CDN Layer
    • Tokenomics
      • UBI Allocation Curve
      • Computing Provider Income
      • Computing Provider Collateral
        • Collateral Requirement and Computing Unit
        • DePIN Oracle
      • Governance
        • Treasure DAO
    • Glossary
  • Swan Chain Campaign
    • Swan CP UBI
    • Swan Chain Mainnet
      • Network Information
      • Swan Token
      • Swan Chain Mission
        • Social Mission
        • Onchain Mission
        • Mission: Celestial Bloom
      • Swan Provider Campaign
        • Fog Computing Provider (FCP)
        • Edge Computing Provider (ECP)
        • Market Provider (MP)
      • GALXE Campaign
      • Free Tier and Special Credit Programs
    • Atom Accelerator Race
      • Before You Get Started
        • Set Up MetaMask
        • Claim SepoliaETH
        • Claim testSWAN
      • CP Acceleration Program
      • Builder Acceleration Program
      • On-chain Interaction Race
      • Community Engagement Challenge
      • FAQ
    • Swan Saturn Testnet
      • Before You Get Started
        • Set Up MetaMask
        • Claim Faucet Tokens
        • Bridge Tokens
      • Transaction Drive Program
      • Community and Educational Events
      • Partnership and Integration Program
      • KOL Program
      • Computing Provider Program
        • FAQ
      • Developer Grant Program
      • FAQ
    • Swan Jupiter Testnet
      • How to Participate
      • Before You Get Started
      • Network Early Adopter
      • FAQ
  • RESOURCE
    • Links
    • Brand Kit
Powered by GitBook
On this page
  • 1. Get Instance Resources
  • Method: swan_orchestrator.get_instance_resources(**kwargs)
  • 2. Create Task
  • Method: swan_orchestrator.create_task(**kwargs)
  • 3. Get Deployment Information
  • Method: swan_orchestrator.get_deployment_info(**kwargs)
  • 4. Get Real URL
  • Method: swan_orchestrator.get_real_url(**kwargs)
  • 5. Renew Task
  • Method: swan_orchestrator.renew_task(**kwargs)
  • 6. Terminate Task
  • Method: swan_orchestrator.terminate_task(**kwargs)
  1. BULDERS
  2. Developer Tools
  3. Swan SDK
  4. Python Swan SDK

SWAN Orchestrator SDK - Function and Parameter Reference

PreviousSpecial Case: Create ssh login instanceNextGo Swan SDK

Last updated 6 months ago

1. Get Instance Resources

Method: swan_orchestrator.get_instance_resources(**kwargs)

Retrieves a list of instance resources (available or all). Provides a comprehensive reference for instance configurations.

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 is True, returns only available resources

  • When available is False, returns all resource configurations

2. Create Task

Method: swan_orchestrator.create_task(**kwargs)

Creates a task on SWAN orchestrator with flexible deployment options.

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:

  1. job_source_uri (Highest priority)

  2. app_repo_image

  3. repo_uri

Notes:

  • At least one of job_source_uri, app_repo_image, or repo_uri must be provided

  • If auto_pay is True, task deployment is automatic

  • If auto_pay is False, manual payment confirmation is required

3. Get Deployment Information

Method: swan_orchestrator.get_deployment_info(**kwargs)

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

-

4. Get Real URL

Method: swan_orchestrator.get_real_url(**kwargs)

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

-

5. Renew Task

Method: swan_orchestrator.renew_task(**kwargs)

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 is False, tx_hash must be provided

  • If auto_pay is True, private_key must be provided

6. Terminate Task

Method: swan_orchestrator.terminate_task(**kwargs)

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

-

Retrieves deployment information for a specific task.

Extends the duration of an existing task.

Terminates a task and provides a refund based on remaining time.

Function Documentation
Function Documentation
Function Documentation
Function Documentation
Function Documentation