Ana içeriğe geç

API İle Cloud Servislerini Nasıl Yönetirsiniz?

Api erişim bilgileri için openrc dosyasını indirmelisiniz

https://panel.skyatlas.com/project/api_access/openrc/

user-openrc.sh dosyasını indirip source ile çalıştırın

source user-openrc.sh

Cloud servislerini yönetmek için openstackclient'ı kurun

https://docs.openstack.org/python-openstackclient/wallaby/

pip install python-openstackclient==5.5.1

Kurulumun ardından dilerseniz openstack help yada doküman adresinden kullanım detaylarını inceleyebilirsiniz.

Aşağıda temel servislerimize ilişkin komut setleri paylaşılmıştır

Networks

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Networks           | `openstack network list`                         |
| Show Network Details    | `openstack network show <network ID>`            |
| Create Network          | `openstack network create <network name>`        |
| Update Network          | `openstack network set <key> <value> <network ID>`|
| Delete Network          | `openstack network delete <network ID>`          |

Subnets

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Subnets            | `openstack subnet list`                          |
| Show Subnet Details     | `openstack subnet show <subnet ID>`              |
| Create Subnet           | `openstack subnet create --network <network ID> --subnet-range <subnet CIDR> <subnet name>` |
| Update Subnet           | `openstack subnet set <key> <value> <subnet ID>` |
| Delete Subnet           | `openstack subnet delete <subnet ID>`            |

Routers

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Routers            | `openstack router list`                          |
| Show Router Details     | `openstack router show <router ID>`              |
| Create Router           | `openstack router create <router name>`          |
| Update Router           | `openstack router set <key> <value> <router ID>` |
| Attach Subnet to Router  | `openstack router add subnet <router ID> <subnet ID>` |
| Detach Subnet from Router| `openstack router remove subnet <router ID> <subnet ID>` |
| Delete Router           | `openstack router delete <router ID>`           |

Security Groups

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Security Groups    | `openstack security group list`                  |
| Show Security Group Details | `openstack security group show <security group ID>` |
| Create Security Group   | `openstack security group create <security group name>` |
| Update Security Group   | `openstack security group set <key> <value> <security group ID>` |
| List Rules in Security Group | `openstack security group rule list <security group ID>` |
| Add Rule to Security Group | `openstack security group rule create <key> <value> <security group ID>` |
| Delete Rule from Security Group | `openstack security group rule delete <rule ID>` |
| Delete Security Group   | `openstack security group delete <security group ID>` |

Key Pairs

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Key Pairs          | `openstack key pairs list`                       |
| Show Key Pairs Details  | `openstack key pairs show <key pairs ID>`        |
| Create Key Pairs        | `openstack keypair create --private-key <file path> <key pair name>` |
| Delete Key Pair         | `openstack key pair delete <key pair ID>`        |

Instances

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Instances          | `openstack server list`                          |
| Show Instance Details   | `openstack server show <instance ID>`            |
| Create Instance         | `openstack server create --flavor <flavor name> --image <image ID> --network <network ID> --key-name <key pair name> <instance name>` |
| Update Instance         | `openstack server set <key> <value> <instance ID>`|
| Delete Instance         | `openstack server delete <instance ID>`          |

Floating IPs

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Floating IPs       | `openstack floating ip list`                     |
| Create Floating IP      | `openstack floating ip create <network ID>`      |
| Attach Floating IP to Instance | `openstack server add floating ip <instance ID> <floating IP ID>` |
| Detach Floating IP from Instance | `openstack server remove floating ip <instance ID> <floating IP ID>` |
| Delete Floating IP      | `openstack floating ip delete <floating IP ID>` |

Volumes

| Action                  | Command                                          |
|-------------------------|--------------------------------------------------|
| List Volumes            | `openstack volume list`                          |
| Show Volume Details     | `openstack volume show <volume ID>`              |
| Create Volume           | `openstack volume create --size <size [GB]> <volume name>` |
| Update Volume           | `openstack volume set <key> <value> <volume ID>` |
| Attach Volume to Instance| `openstack server add volume <instance ID> <volume ID>` |
| Detach Volume from Instance | `openstack server remove volume <instance ID> <volume ID>` |
| Delete Volume           | `openstack volume delete <volume ID>`           |

Object Storage Containers (Buckets)

| Action                   | Command                                                       |
|--------------------------|---------------------------------------------------------------|
| Create Container         | `openstack container create <container>`                      |
| Delete Container         | `openstack container delete <container>`                      |
| List Containers          | `openstack container list`                                    |
| Save Container Locally   | `openstack container save <container>`                        |
| Set Container Properties | `openstack container set --property <key=value> <container>`  |
| Show Container Details   | `openstack container show <container>`                        |
| Unset Container Properties| `openstack container unset --property <key> <container>`     |

Object Storage Objects

| Action                   | Command                                                       |
|--------------------------|---------------------------------------------------------------|
| Create Object            | `openstack object create [--options] <container> <filename>`  |
| Delete Object            | `openstack object delete <container> <object>`                |
| List Objects             | `openstack object list [--options] <container>`               |
| Save Object Locally      | `openstack object save [--file <filename>] <container> <object>` |
| Set Object Properties    | `openstack object set --property <key=value> <container> <object>` |
| Show Object Details      | `openstack object show <container> <object>`                  |
| Unset Object Properties  | `openstack object unset --property <key> <container> <object>`|