Módosítások

Cloud for Education

10 067 bájt hozzáadva, 2017. május 3., 21:34
API használata
== API használata ==
 
Az API használatával kapcsolatban a mindenkori Openstack dokumentáció a mérvadó: https://developer.openstack.org/api-guide/quick-start/api-quick-start.html#
 
Ugyanezen oldalról egy (hálózat/ssh kulcs nélküli!) instance elindításának kezdő lépései: https://developer.openstack.org/api-guide/quick-start/api-quick-start.html#launch-an-instance
 
Az openstack parancs elérhető funkciói (ebből természetesen van, ami a felhasználó számára nem, illetve olyan is, ami nincs implementálva!):
 
Részlet az <big>openstack --help </big> kiementéből:
 
<pre>
Commands:
access token create Create access token command
aggregate add host Add host to aggregate
aggregate create Create a new aggregate
aggregate delete Delete an existing aggregate
aggregate list List all aggregates
aggregate remove host Remove host from aggregate
aggregate set Set aggregate properties
aggregate show Show a specific aggregate
backup create Create backup command
backup delete Delete backup command
backup list List backup command
backup restore Restore backup command
backup show Show backup command
complete print bash completion command
compute agent create Create compute agent command
compute agent delete Delete compute agent command
compute agent list List compute agent command
compute agent set Set compute agent command
compute service list List service command
compute service set Set service command
console log show Show console-log command
console url show Show console-url command
consumer create Create consumer command
consumer delete Delete consumer command
consumer list List consumer command
consumer set Set consumer command
consumer show Show consumer command
container list List containers
container show Show container information
credential create Create credential command
credential delete Delete credential command
credential list List credential command
credential set Set credential command
credential show Show credential command
domain create Create domain command
domain delete Delete domain command
domain list List domain command
domain set Set domain command
domain show Show domain command
endpoint create Create endpoint command
endpoint delete Delete endpoint command
endpoint list List endpoint command
endpoint set Set endpoint command
endpoint show Show endpoint command
extension list List extension command
flavor create Create flavor command
flavor delete Delete flavor command
flavor list List flavor command
flavor show Show flavor command
group add user Add user to group
group contains user Checks that user is in a specific group
group create Create group command
group delete Delete group command
group list List groups
group remove user Remove user to group
group set Set group command
group show Show group command
help print detailed help for another command
host list List host command
host show Show host command
hypervisor list List hypervisor command
hypervisor show Show hypervisor command
identity provider create Create identity_provider command
identity provider delete Delete identity provider
identity provider list List identity providers
identity provider set Set identity provider
identity provider show Show identity provider
image create Create/upload an image
image delete Delete an image
image list List available images
image save Save an image locally
image set Change image properties
image show Show image details
ip fixed add Add fixed-ip command
ip fixed remove Remove fixed-ip command
ip floating add Add floating-ip command
ip floating create Create floating-ip command
ip floating delete Delete floating-ip command
ip floating list List floating-ip command
ip floating pool list List floating-ip-pool command
ip floating remove Remove floating-ip command
keypair create Create keypair command
keypair delete Delete keypair command
keypair list List keypair command
keypair show Show keypair command
limits show Show compute and volume limits
module list List module versions
object list List objects
object show Show object information
policy create Create policy command
policy delete Delete policy command
policy list List policy command
policy set Set policy command
policy show Show policy command
project create Create new project
project delete Delete project
project list List projects
project set Set project properties
project show Show project command
project usage list List resource usage per project.
quota set Set quotas for project or class
quota show Show quotas for project or class
request token authorize Authorize request token command
request token create Create request token command
role add Adds a role to a user or group on a domain or project
role assignment list Lists role assignments according to the given filters
role create Create new role
role delete Delete existing role
role list List roles
role remove Remove role command
role set Set role command
role show Show single role
security group create Create a new security group
security group delete Delete a security group
security group list List all security groups
security group rule create Create a new security group rule
security group rule delete Delete a security group rule
security group rule list List all security group rules
security group set Set security group properties
security group show Show a specific security group
server add security group Add security group to server
server add volume Add volume to server
server create Create a new server
server delete Delete server command
server image create Create a new disk image from a running server
server list List servers
server lock Lock server
server migrate Migrate server to different host
server pause Pause server
server reboot Perform a hard or soft server reboot
server rebuild Rebuild server
server remove security group Remove security group from server
server remove volume Remove volume from server
server rescue Put server in rescue mode
server resize Convert server to a new flavor
server resume Resume server
server set Set server properties
server show Show server details
server ssh Ssh to server
server suspend Suspend server
server unlock Unlock server
server unpause Unpause server
server unrescue Restore server from rescue mode
server unset Unset server properties
service create Create new service
service delete Delete service
service list List services
service set Set service properties
service show Show service details
snapshot create Create snapshot command
snapshot delete Delete snapshot command
snapshot list List snapshot command
snapshot set Set snapshot command
snapshot show Show snapshot command
token issue Issue token command
user create Create new user
user delete Delete user
user list List users
user set Set user properties
user show Show user details
volume create Create new volume
volume delete Delete volume
volume list List volumes
volume set Set volume properties
volume show Show specific volume
volume type create Create new volume type
volume type delete Delete volume type
volume type list List volume types
volume type set Set volume type property
volume type unset Unset volume type property
volume unset Unset volume properties
</pre>
 
Az egyes parancsok részletes leírását így lehet elérni:
<pre>
debian@apitest:~$ openstack help server list
usage: openstack server list [-h] [-f {csv,table}] [-c COLUMN]
[--max-width <integer>]
[--quote {all,minimal,none,nonnumeric}]
[--reservation-id <reservation-id>]
[--ip <ip-address-regex>]
[--ip6 <ip-address-regex>] [--name <name>]
[--status <status>] [--flavor <flavor>]
[--image <image>] [--host <hostname>]
[--instance-name <server-name>] [--all-projects]
[--long]
 
List servers
 
optional arguments:
-h, --help show this help message and exit
--reservation-id <reservation-id>
Only return instances that match the reservation
--ip <ip-address-regex>
Regular expression to match IP addresses
--ip6 <ip-address-regex>
Regular expression to match IPv6 addresses
--name <name> Regular expression to match names
--status <status> Search by server status
--flavor <flavor> Search by flavor ID
--image <image> Search by image ID
--host <hostname> Search by hostname
--instance-name <server-name>
Regular expression to match instance name (admin only)
--all-projects Include all projects (admin only)
--long List additional fields in output
 
output formatters:
output formatter options
 
-f {csv,table}, --format {csv,table}
the output format, defaults to table
-c COLUMN, --column COLUMN
specify the column(s) to include, can be repeated
 
table formatter:
--max-width <integer>
Maximum display width, 0 to disable
 
CSV Formatter:
--quote {all,minimal,none,nonnumeric}
when to include quotes, defaults to nonnumeric
 
debian@apitest:~$
</pre>
 
Amennyiben valamilyen problémába merül fel, célszerű a parancsot -v (-vv -vvv) kapcsolóval futtatni, és egy esetleges hibabejelentésnél a kimenetet csatolni.
=FAQ=

Navigációs menü