2019-09-13 05:40:22 +00:00
|
|
|
# ucloud-cli
|
|
|
|
|
|
|
|
|
|
|
|
### Listing available ucloud products
|
|
|
|
|
|
|
|
```
|
|
|
|
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py product list
|
|
|
|
{
|
|
|
|
"/v1/products/": {
|
|
|
|
"description": "YEARLY IPV6 subscription",
|
|
|
|
"name": "IPV6 VPN",
|
|
|
|
"price": 12000,
|
|
|
|
"recurring_duration": 31536000,
|
|
|
|
"recurring_duration_units": 0,
|
|
|
|
"type": "recurring"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Adding new products
|
|
|
|
```
|
|
|
|
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py product add \
|
2019-09-19 05:56:10 +00:00
|
|
|
--name xxxxxxxxxxxx \
|
|
|
|
--realm xxxxxxxxxxxx \
|
|
|
|
--seed xxxxxxxxxxxx \
|
2019-09-13 05:40:22 +00:00
|
|
|
--product-name "IPV6 VPN" \
|
|
|
|
--product-description="YEARLY IPV6 subscription" \
|
|
|
|
--product-type=recurring \
|
2019-09-19 05:56:10 +00:00
|
|
|
--product-recurring-period=year \
|
|
|
|
--product-price=12000 \
|
|
|
|
--product-minimum-subscription-period=year
|
2019-09-13 05:40:22 +00:00
|
|
|
|
2019-09-14 11:25:24 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Register a payment method (cc for now)
|
|
|
|
|
|
|
|
```
|
|
|
|
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py user register-payment \
|
|
|
|
--name xxxxxxxxxxxx \
|
|
|
|
--realm xxxxxxxx \
|
|
|
|
--seed xxxxxxxxxx \
|
|
|
|
--cc --number 4242424242424242 \
|
|
|
|
--cvc 225 \
|
|
|
|
--expiry-month 08 \
|
|
|
|
--expiry-year 2022 \
|
|
|
|
--card-holder-name "The tester" \
|
|
|
|
--email "monty@python.com"
|
2019-09-14 17:22:37 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Order a product
|
|
|
|
|
|
|
|
```
|
|
|
|
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py product order \
|
|
|
|
--name xxxxxxxxxxxxxxxxx \
|
|
|
|
--realm xxxxxxxxxxxxxxxx \
|
|
|
|
--seed xxxxxxxxxxxxxxxx \
|
|
|
|
--email "monty@python.com" \
|
|
|
|
--product-id aabc34208e514803a0ee62d697b37e8c
|
|
|
|
```
|
|
|
|
|
|
|
|
### Listing different orders
|
|
|
|
|
|
|
|
```
|
|
|
|
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=127.0.0.1:5000 python ucloud.py order list \
|
|
|
|
--name xxxxxxxxxxxxxxx \
|
|
|
|
--realm xxxxxxxxxxxxxxx \
|
|
|
|
--seed xxxxxxxxxxxxxxxxx \
|
|
|
|
--email "monty@python.com"
|
2019-09-13 05:40:22 +00:00
|
|
|
```
|