Welcome to contrail-api-cli-extra’s documentation!¶
contrail_api_cli_extra package¶
This package contains contrail-api-cli commands to ease operating/fixing a contrail installation.
Commands are grouped in different packages with different purposes:
contrail_api_cli_extra.clean
: commands to detect and remove bad resourcescontrail_api_cli_extra.fix
: commands to detect and fix bad resourcescontrail_api_cli_extra.migration
: commands to handle data migration when upgrading contrail to a new major versioncontrail_api_cli_extra.misc
: general purpose commandscontrail_api_cli_extra.provision
: commands used to provision/configure a contrail installation
Installation¶
In the contrail-api-cli-extra directory run:
python setup.py install
If all goes well you will see new commands in contrail-api-cli:
contrail-api-cli --host 1.2.3.4 shell
1.2.3.4:/> help
Available commands: schema shell exec edit tree cat relative ln kv rm python du
ls find-orphaned-projects fix-subnets fix-vn-id fix-fip-locks reschedule-vm fix-sg
rpf provision dot exit help cd
Subpackages¶
- contrail_api_cli_extra.clean package
- contrail_api_cli_extra.fix package
- contrail_api_cli_extra.migration package
- contrail_api_cli_extra.misc package
- contrail_api_cli_extra.provision package
- contrail_api_cli_extra.provision.analytics module
- contrail_api_cli_extra.provision.bgp_router module
- contrail_api_cli_extra.provision.common module
- contrail_api_cli_extra.provision.config module
- contrail_api_cli_extra.provision.dns_nameserver module
- contrail_api_cli_extra.provision.encapsulation module
- contrail_api_cli_extra.provision.global_asn module
- contrail_api_cli_extra.provision.linklocal module
- contrail_api_cli_extra.provision.lr module
- contrail_api_cli_extra.provision.provision module
- contrail_api_cli_extra.provision.route_target module
- contrail_api_cli_extra.provision.service_appliance_set module
- contrail_api_cli_extra.provision.subnet module
- contrail_api_cli_extra.provision.vn module
- contrail_api_cli_extra.provision.vrouter module
contrail_api_cli_extra.utils module¶
Shared functions and classes for contrail_api_cli_extra commands.
-
class
contrail_api_cli_extra.utils.
CassandraCommand
(name)¶ Bases:
contrail_api_cli.command.Command
Inherit from this class to add –cassandra-servers options.
Cassandra servers list value is stored in self.cassandra_servers.
-
class
contrail_api_cli_extra.utils.
CheckCommand
(name)¶ Bases:
contrail_api_cli.command.Command
Inherit from this class to add –check and –dry-run options.
Options values are stored in self.check and self.dry_run (True or False).
-
class
contrail_api_cli_extra.utils.
ConfirmCommand
(name)¶ Bases:
contrail_api_cli.command.Command
Inherit from this class for a command that expect a confirmation.
This will add a –yes flag to skip the confirmation. self.yes can be used by the command to show the confirmation or not.
-
confirm_message
¶ Confirmation message to run the command
-
-
class
contrail_api_cli_extra.utils.
PathCommand
(name)¶ Bases:
contrail_api_cli.command.Command
Inherit from this class for a command that expect a list of resource paths.
This will add a path argument to the command (nargs=*).
The selected resources are available in self.resources.
-
resource_type
¶ Type of resource the command is about.
-
-
class
contrail_api_cli_extra.utils.
RouteTargetAction
(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)¶ Bases:
argparse.Action
-
class
contrail_api_cli_extra.utils.
ZKCommand
(name)¶ Bases:
contrail_api_cli.command.Command
Inherit from this class when a connection to the Zookeeper cluster is needed.
This will add a –zk-server option to the command.
The ZK client is available in self.zk_client.
-
contrail_api_cli_extra.utils.
format_table_ascii_delimiters
(header, widths, data)¶ Return ascii table with delimitation and lines wrapped.
usage:
header = ["name", "age", "job", "bag"] widths = [20, 4, 10, 40] data = [ ["foo", 54, "policeman", ("pen", "knife", "glasses")], ["bar", 28, "fireman", ("socket", "hat")], ["joe", 36, "anthropologist", ("computer", "keyboard")] ] format_table2(header, widths, data)
return:
+------+-----+------------+------------+ | name | age | job | bag | +------+-----+------------+------------+ | foo | 54 | policeman | - pen | | | | | - knife | | | | | - glasses | | | | | | | bar | 28 | fireman | - socket | | | | | - hat | | | | | | | joe | 36 | anthropolo | - computer | | | | gist | - keyboard | | | | | | +------+-----+------------+------------+
-
contrail_api_cli_extra.utils.
ip_type
(string)¶ argparse type to validate IP adresses.
-
contrail_api_cli_extra.utils.
md5_type
(value)¶ argparse type to validate a md5 hash.
-
contrail_api_cli_extra.utils.
network_type
(string)¶ argparse type to validate network adresses.
-
contrail_api_cli_extra.utils.
port_type
(value)¶ argparse type to validate port numbers.
-
contrail_api_cli_extra.utils.
server_type
(value)¶ argparse type to validate a server:port option.