A Sample Tutorial
New client
Fetch all instance resources
Through InstanceResources
you can get a list of available instance resources including their region information. You can select one you want to use.
Note: All Instance type list can be found here.
Create and deploy a task
Deploy a application, if you have set PrivateKey
, this task will be payed automaiclly, and deploy to computing providers on Swan Chain Network:
Access application instances of an existing task
You can easily get the deployed application instances for an existing task.
A sample output:
It shows that this task has three applications. Visit the URL in the web browser you will view the application's information if it is running correctly.
Renew duration of an existing task
RenewTask
extends the duration of the task before completed
Terminate an existing task
You can early terminate an existing task and its application instances. By terminating task, you will stop all the related running application instances and thus you will get refund of the remaining task duration.
Check information of an existing task
You can get the task details by the taskUUID
Check all task list information belonging to a wallet address
You can get all tasks deployed from one wallet address
More Samples
For more pratical samples, consult go-swan-sdk-samples.
More Resources
More resources about swan SDK can be found
License
The go-swan-sdk
is released under the MIT license, details of which can be found in the LICENSE file.
Last updated