diff --git a/docs/netmgr.python.md b/docs/netmgr.python.md index d08c24fe44..e281e6c39f 100644 --- a/docs/netmgr.python.md +++ b/docs/netmgr.python.md @@ -21,22 +21,21 @@ To set up and run the latest version of the Network Manager API for Python: # Initialization Steps ~~~~ # python3 ->>> import pmd ->>> net = pmd.server().net ->>> net._command_ +>>> import pmd +>>> net = pmd.server().net ~~~~ # Get Online Help Get help for all commands. ~~~~ ->>> help(net) +>>> help(net) ~~~~ Get help for a specific command. ~~~~ ->>> help(net.add_ntp_servers) +>>> help(net.add_ntp_servers) -in function add_ntp_servers: add_ntp_servers(...) method of [server.net](http://server.net/) instance - net.add_ntp_servers(ntpservers = ["20.20.20.20", "25.30.40.70"]) + net.add_ntp_servers(ntpservers = ["20.20.20.20", "25.30.40.70"]) adds ntp servers. returns success: 0, failure: exception. (END) ~~~~ @@ -57,15 +56,11 @@ net.get_system_network_info() **Example** ~~~~ ->>> system_network_info = netmgmt.get_system_network_info() +>>> system_network_info = netmgmt.get_system_network_info() ->>> type (system_network_info) +>>> print ( system_network_info) -<class 'list'> - ->>> print ( system_network_info) - -[{DUID: 00:02:11:22:33:44:55:66:77:20, DNS Mode: (null), DNS ServerList: ['10.10.100.100', '20.20.200.10'], DNS domain list: [' [abcd.com](http://abcd.com)'], NTP ServerList: (null)}] +[{DUID: 00:02:11:22:33:44:55:66:77:20, DNS Mode: (null), DNS ServerList: ['10.10.100.100', '20.20.200.10'], DNS domain list: [' [abcd.com](http://abcd.com)'], NTP ServerList: (null)}] ~~~~ ### get_err_info @@ -73,7 +68,7 @@ Get information about the specified error number. **Syntax** ~~~~ -net.get_err_info(error = <error_number>) +net.get_err_info(error = ) ~~~~ **Parameters** @@ -100,9 +95,9 @@ Here is the list of error numbers: Example ~~~~ ->> net.get_err_info(error = 4097) +>> net.get_err_info(error = 4097) -'invalid parameter' +'invalid parameter' ~~~~ # Interface Configuration @@ -509,7 +504,7 @@ Set the list of DNS domains for the specified interface. **Syntax** ~~~~ -net.set_dns_domains(domains = ["domain1","domain2",...], ifname = interface_name) +net.set_dns_domains(domains = ["domain1","domain2",...], ifname = interface_name) ~~~~ **Parameters** @@ -527,7 +522,7 @@ Set the list of DNS servers for the specified interface. **Syntax** ~~~~ -net.set_dns_servers(dns_mode = [dhcp, static], servers = ["server1","server2", ...], ifname = interface_name) +net.set_dns_servers(dns_mode = [dhcp, static], servers = ["server1","server2", ...], ifname = interface_name) ~~~~ **Parameters** @@ -565,7 +560,7 @@ Set the IAID for the specified interface. **Syntax** ~~~~ -net.set_link_iaid(ifname = interface_name, iaid = <iaid>) +net.set_link_iaid(ifname = interface_name, iaid = ) ~~~~ **Parameters** @@ -622,7 +617,7 @@ Add one or more NTP servers to the NTP servers list. **Syntax** ~~~~ -net.add_ntp_servers(ntpservers = ["server1", "server2", ...]) +net.add_ntp_servers(ntpservers = ["server1", "server2", ...]) ~~~~ **Parameters** @@ -639,7 +634,7 @@ Remove one or more NTP servers from the NTP servers list. **Syntax** ~~~~ -net.del_ntp_servers(ntpservers = ["server1", "server2", ...]) +net.del_ntp_servers(ntpservers = ["server1", "server2", ...]) ~~~~ **Parameters** @@ -669,7 +664,7 @@ Set the NTP servers list. **Syntax** ~~~~ -net.set_ntp_servers(ntpservers = ["server1", "server2", ...]) +net.set_ntp_servers(ntpservers = ["server1", "server2", ...]) ~~~~ **Parameters** @@ -781,4 +776,4 @@ net.set_network_param(object = interface_name or filename, paramname = SectionNa **Returns** - success: 0 -- failure: exception \ No newline at end of file +- failure: exception diff --git a/docs/pmd-cli.md b/docs/pmd-cli.md index ab9ee18844..b7ea050b30 100644 --- a/docs/pmd-cli.md +++ b/docs/pmd-cli.md @@ -17,7 +17,7 @@ tndf install pmd-cli ~~~~ # Syntax ~~~~ -pmd-cli [connection_auth_options] <component> <command> [command_options] +pmd-cli [connection_auth_options] [command_options] ~~~~ Passed-in parameter values can be enclosed in single (') or double-quotes (") as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether. @@ -27,7 +27,7 @@ Passed-in parameter values can be enclosed in single (') or double-quotes (& For local connections, you omit the connection and authorization options: ~~~~ -pmd-cli <component> <cmd> <options> +pmd-cli ~~~~ Permissions for the currently logged-in user apply when executing commands. This is the same as specifying --servername localhost. @@ -44,23 +44,23 @@ What follows are three options for remote connections. **System User** ~~~~ -pmd-cli --servername <server> --user <username> +pmd-cli --servername --user ~~~~ **Lightwave User** Before using this method, the pmd server must be joined or should be part of embedded Lightwave. ~~~~ -pmd-cli --servername <server> --user <username> --domain <lightwave_domain> +pmd-cli --servername --user --domain ~~~~ **Kerberos spn** Before using this method, the client must run kinit successfully. ~~~~ -pmd-cli --servername <server> --spn <service_principal_name> +pmd-cli --servername --spn ~~~~ ## Component -``<component>`` is one of the following values: +```` is one of the following values: - ``firewall`` - ``net`` @@ -73,7 +73,7 @@ The Photon Management Daemon provides CLI commands to help you get information a ## Syntax ~~~~ -pmd-cli [connection_auth_options] firewall <command> [command_options] +pmd-cli [connection_auth_options] firewall [command_options] ~~~~ ## firewall help @@ -91,17 +91,17 @@ This command returns information about each firewall rule, such as the chain to Add a new firewall rule. ~~~~ -pmd-cli firewall rules --chain <chain_name> --add <rule_specification> +pmd-cli firewall rules --chain --add ~~~~ Example: ~~~~ -pmd-cli firewall rules --chain INPUT --add "-p tcp -m tcp --dport 21 -j ACCEPT" +pmd-cli firewall rules --chain INPUT --add "-p tcp -m tcp --dport 21 -j ACCEPT" ~~~~ **Note:** To confirm that the firewall rule was added, run iptables -S. Running pmd-cli firewall rules lists only persistent rules. Delete a new firewall rule. ~~~~ -pmd-cli firewall rules --chain <chain_name> --delete <rule_specification> +pmd-cli firewall rules --chain --delete ~~~~ **Note:** To confirm that the firewall rule was removed, run iptables -S. Running pmd-cli firewall rules lists only persistent rules. @@ -117,7 +117,7 @@ The Photon Management Daemon provides CLI commands to help you manage network in ## Syntax ~~~~ -pmd-cli [connection_auth_options] net <command> [command_options] +pmd-cli [connection_auth_options] net [command_options] ~~~~ Many of these commands require the interface name (–interface <ifname>). IP addresses can be specified in dot-decimal notation or as prefixes. Other command options are described below. @@ -125,53 +125,53 @@ Many of these commands require the interface name (–interface <ifname>). Get the mac address, mtu, link state, and link mode for the specified interface. ~~~~ -pmd-cli net link_info --get --interface <ifame> +pmd-cli net link_info --get --interface ~~~~ Set the MAC address, mode (manual or auto), link state (up or down), link mode (manual or auto), and MTU for the specified interface. ~~~~ -pmd-cli net link_info --set --interface <ifname> --macaddr <mac_address> --mode <manual|auto> --state <up|down> --mtu <mtu> +pmd-cli net link_info --set --interface --macaddr --mode --state --mtu ~~~~ ## net ip4_address Get the IPv4 address for the specified interface. ~~~~ -pmd-cli net ip4_address --get --interface <ifame> +pmd-cli net ip4_address --get --interface ~~~~ Set the IPv4 address (dot-decimal or prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface. ~~~~ -pmd-cli net ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <IPv4Address/prefix> --gateway <gateway_address> +pmd-cli net ip4_address --set --interface --mode --addr --gateway ~~~~ ## net ip6_address Get IPv6 address(es) for the specified interface. ~~~~ -pmd-cli net ip6_address --get --interface <ifame> +pmd-cli net ip6_address --get --interface ~~~~ Add one or more IPv6 addresses (comma-separated list in dot-decimal or prefix notation) to the specified interface. ~~~~ -pmd-cli net ip6_address --add --interface <ifame> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...> +pmd-cli net ip6_address --add --interface --addrlist ~~~~ Delete one or more IPv6 addresses (comma-separated list in dot-decimal or prefix notation) from the specified interface. ~~~~ -pmd-cli net ip6_address --del --interface <ifame> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...> +pmd-cli net ip6_address --del --interface --addrlist ~~~~ Set the DHCP mode (1=enable, 0=disable) and autoconfigure settings (1=enable, 0=disable) for the specified interface. ~~~~ -pmd-cli net ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0> +pmd-cli net ip6_address --set --interface --dhcp <1|0> --autoconf <1|0> ~~~~ ## net ip_route Get the static IP route for the specified interface. ~~~~ -pmd-cli net ip_route --get --interface <ifame> +pmd-cli net ip_route --get --interface ~~~~ Add the static IP route (gateway IP, destination network, and metric) to the specified interface. ~~~~ -pmd-cli net ip_route --add --interface <ifname> --gateway <GatewayIP> --destination <DestinationNetwork/prefix> --metric <N> +pmd-cli net ip_route --add --interface --gateway --destination --metric ~~~~ Delete the specified static IP route from the specified interface. ~~~~ -pmd-cli net ip_route --del --interface <ifname> --destination <DestIP/N> +pmd-cli net ip_route --del --interface --destination ~~~~ ## net dns_servers @@ -181,15 +181,15 @@ pmd-cli net dns_servers --get ~~~~ Set the DNS mode (dhcp or static) for one or more DNS servers (comma-separated list). ~~~~ -pmd-cli net dns_servers --set --mode <dhcp|static> --servers <server1,server2,...> +pmd-cli net dns_servers --set --mode --servers ~~~~ Add a DNS server to the list of DNS servers. ~~~~ -pmd-cli net dns_servers --add --servers <server> +pmd-cli net dns_servers --add --servers ~~~~ Remove the specified DNS server from the list of DNS servers. ~~~~ -pmd-cli net dns_servers --del --servers <server> +pmd-cli net dns_servers --del --servers ~~~~ ## net dns_domains @@ -199,15 +199,15 @@ pmd-cli net dns_domains --get ~~~~ Set the list of DNS domains (one or more DNS domains in a comma-separated list). ~~~~ -pmd-cli net dns_domains --set --domains <domain1,domain2,...> +pmd-cli net dns_domains --set --domains ~~~~ Add a DNS domain to the list of DNS domains. ~~~~ -pmd-cli net dns_domains --add --domains <domain1> +pmd-cli net dns_domains --add --domains ~~~~ Delete a DNS domain from the list of DNS domains. ~~~~ -pmd-cli net dns_domains --del --domains <domain1> +pmd-cli net dns_domains --del --domains ~~~~ ## net dhcp_duid @@ -217,17 +217,17 @@ pmd-cli net dhcp_duid --get ~~~~ Set the DHCP DUID for all interfaces in the system. ~~~~ -pmd-cli net dhcp_duid --set --duid <duid> +pmd-cli net dhcp_duid --set --duid ~~~~ ## net if_iaid Get the IAID for the specified interface. ~~~~ -pmd-cli net if_iaid --get --interface <ifname> +pmd-cli net if_iaid --get --interface ~~~~ Set the IAID for the specified interface. ~~~~ -pmd-cli net if_iaid --set --interface <ifname> --iaid <iaid> +pmd-cli net if_iaid --set --interface --iaid ~~~~ ## net ntp_servers @@ -237,15 +237,15 @@ pmd-cli net ntp_servers --get ~~~~ Set the NTP servers list. ~~~~ -pmd-cli net ntp_servers --set --servers <server1,server2,...> +pmd-cli net ntp_servers --set --servers ~~~~ Add the specified server to the NTP servers list. ~~~~ -pmd-cli net ntp_servers --add --servers <server> +pmd-cli net ntp_servers --add --servers ~~~~ Delete the specified server from the NTP servers list. ~~~~ -pmd-cli net ntp_servers --del --servers <server> +pmd-cli net ntp_servers --del --servers ~~~~ ## net hostname @@ -255,13 +255,13 @@ pmd-cli net hostname --get ~~~~ Set the system hostname. ~~~~ -pmd-cli net hostname --set --name <hostname> +pmd-cli net hostname --set --name ~~~~ ## net wait_for_link Wait for the specified network interface to be up and usable (it can send and receive packets). ~~~~ -pmd-cli net wait_for_link --interface <ifname> --timeout <timeout> +pmd-cli net wait_for_link --interface --timeout ~~~~ The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely). @@ -271,7 +271,7 @@ The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no ti Wait for the specified interface to acquire a valid IP address for the specified address type. ~~~~ -pmd-cli net wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6> +pmd-cli net wait_for_ip --interface --timeout --addrtype ~~~~ The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely). @@ -279,7 +279,7 @@ The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no ti Get error information about the specified error code. ~~~~ -pmd-cli net error_info --errcode <error_code> +pmd-cli net error_info --errcode ~~~~ Here is a list of error codes: @@ -299,13 +299,13 @@ Here is a list of error codes: Get the specified network configuration parameter for the specified object. ~~~~ -pmd-cli net net_info --get --object <ifname or filename> --paramname <param_name> +pmd-cli net net_info --get --object --paramname ~~~~ **Note:** The object can be an interface name (for example, "eth0") or a file name (for example, /etc/systemd/resolved.conf). Set the value of the specified network configuration parameter for the specified object (interface or file). ~~~~ -pmd-cli net net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value> +pmd-cli net net_info --set --object --paramname --paramvalue ~~~~ **Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -. @@ -315,11 +315,11 @@ The Photon Management Daemon provides CLI commands to help you manage packages a ## Syntax ~~~~ -pmd-cli [connection options] pkg <command> [command options] +pmd-cli [connection options] pkg [command options] ~~~~ If a command allows for multiple package names, simply specify on the command line, separated by spaces. ~~~~ -pmd-cli pkg info <package_name_1> <package_name_2> <package_name_3> ... +pmd-cli pkg info ... ~~~~ ## pkg help @@ -343,19 +343,19 @@ pmd-cli pkg distro-sync Downgrade the specified package(s). If no packages are specified, then all available packages are downgraded. ~~~~ -pmd-cli pkg downgrade <package_name> +pmd-cli pkg downgrade ~~~~ ## pkg erase Remove the specified package(s). ~~~~ -pmd-cli pkg erase <package_name> +pmd-cli pkg erase ~~~~ ## pkg info Get general information about the specified package(s), such as name, version, release, repository, install size, and so on. ~~~~ -pmd-cli pkg info <package_name> +pmd-cli pkg info ~~~~ If no packages are specified, then this command returns information about all packages. ~~~~ @@ -363,7 +363,7 @@ If no packages are specified, then this command returns information about all pa ~~~~ Install the specified package(s). Update the package if an update is available. ~~~~ -pmd-cli pkg install <package_name> +pmd-cli pkg install ~~~~ ## pkg list @@ -383,7 +383,7 @@ pmd-cli pkg list ph\* Reinstall the specified package(s). ~~~~ -pmd-cli pkg reinstall <package_name> +pmd-cli pkg reinstall ~~~~ ## pkg repolist @@ -397,7 +397,7 @@ This command returns a list of the configured software repositories, including t Update the specified package(s). ~~~~ -pmd-cli pkg update <package_name> +pmd-cli pkg update ~~~~ If no parameters are specified, then all available packages are updated. @@ -413,7 +413,7 @@ The Photon Management Daemon provides CLI commands to help you manage users and ## Syntax ~~~~ -pmd-cli [connection options] usr <command> [command options] +pmd-cli [connection options] usr [command options] ~~~~ ## usr help @@ -431,7 +431,7 @@ pmd-cli usr users Add a new user. Specify the username. ~~~~ -pmd-cli usr useradd <username> +pmd-cli usr useradd ~~~~ The system assigns a user ID, home directory, and default shell to the new user. The user group is unspecified. @@ -439,13 +439,13 @@ The system assigns a user ID, home directory, and default shell to the new user. Delete the specified user. ~~~~ -pmd-cli usr userdel <username> +pmd-cli usr userdel ~~~~ ## usr userid Get the user ID of the specified user (by name). Used to determine whether the specified user exists. ~~~~ -pmd-cli usr userid <username> +pmd-cli usr userid ~~~~ ## usr groups @@ -457,7 +457,7 @@ pmd-cli usr groups Add a new user group. ~~~~ -pmd-cli usr groupadd <user_group_name> +pmd-cli usr groupadd ~~~~ The system assigns a group ID to the new user group. @@ -465,13 +465,13 @@ The system assigns a group ID to the new user group. Delete the specified user group. ~~~~ -pmd-cli usr groupdel <user_group_name> +pmd-cli usr groupdel ~~~~ ## usr groupid Get the group ID for the specified user group (by name). Used to determine whether the specified user group exists. ~~~~ -pmd-cli usr groupid <user_group_name> +pmd-cli usr groupid ~~~~ ## usr version