Beispiel #1
0
identity_cli.tag_group.commands.pop(
    identity_cli.create_tag_enum_tag_definition_validator.name)
identity_cli.tag_group.commands.pop(
    identity_cli.update_tag_default_tag_definition_validator.name)
identity_cli.tag_group.commands.pop(
    identity_cli.update_tag_enum_tag_definition_validator.name)

cli_util.get_param(identity_cli.create_policy,
                   'version_date').type = click.STRING

# help for oci iam policy create --statements
identity_policy_create_statements_example = """'["statement 1","statement 2"]'"""
identity_policy_create_statements_help = cli_util.GENERIC_JSON_FORMAT_HELP
cli_util.update_param_help(identity_cli.create_policy,
                           'statements',
                           identity_policy_create_statements_help,
                           append=True,
                           example=identity_policy_create_statements_example)

# revised short help for tagging operations
identity_cli.create_tag.short_help = 'Create new tag in a given tagNamespace'
identity_cli.get_tag.short_help = 'Gets the specified tag' 's information'
identity_cli.list_tags.short_help = 'List tags in a given tagNamespace'
identity_cli.create_tag_namespace.short_help = 'Create new tagNamespace in a compartment'
identity_cli.get_tag_namespace.short_help = 'Get a tagNamespace' 's information'
identity_cli.list_tag_namespaces.short_help = 'List the tagNamespaces in a compartment'


@identity_cli.user_group.command(
    name='list-groups',
    help=
Beispiel #2
0
cli_util.rename_command(blockstorage_cli, cli,
                        blockstorage_cli.blockstorage_root_group, "bv")
blockstorage_cli.volume_group.commands.pop(blockstorage_cli.create_volume.name)
blockstorage_cli.boot_volume_group.commands.pop(
    blockstorage_cli.create_boot_volume.name)
cli_util.rename_command(blockstorage_cli,
                        blockstorage_cli.blockstorage_root_group,
                        blockstorage_cli.volume_backup_group, "backup")
blockstorage_cli.blockstorage_root_group.help = "Block Volume Service CLI"
blockstorage_cli.blockstorage_root_group.short_help = "Block Volume Service"

cli_util.update_param_help(
    blockstorage_cli.create_volume,
    'availability_domain',
    """The Availability Domain of the volume. Example: `Uocm:PHX-AD-1`.

This is optional when cloning a volume as the newly created volume will be created in the same Availability Domain as its source. This is required when creating an empty volume or restoring a volume from a backup.""",
    append=False)
cli_util.update_param_help(
    blockstorage_cli.create_volume,
    'compartment_id',
    """The OCID of the compartment that contains the volume. This is optional when cloning a volume or restoring a volume from a backup. If it is not supplied then the volume will be created in the same compartment as the source. This is requied when creating an empty volume.""",
    append=False)
cli_util.update_param_help(
    blockstorage_cli.create_volume,
    'size_in_mbs',
    """[DEPRECATED] The size of the volume in MBs. The value must be a multiple of 1024. This field is deprecated. Use --size-in-gbs instead.""",
    append=False)

# Disable nested inherited commands.
virtualnetwork_cli.virtual_network_root_group.commands.pop(virtualnetwork_cli.network_security_group_vnic_group.name)
virtualnetwork_cli.network_security_group_group.add_command(virtualnetwork_cli.network_security_group_vnic_group)
cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.network_security_group_group, virtualnetwork_cli.network_security_group_vnic_group, "vnics")


virtualnetwork_cli.virtual_network_root_group.commands.pop(virtualnetwork_cli.security_rule_group.name)
virtualnetwork_cli.network_security_group_group.add_command(virtualnetwork_cli.security_rule_group)
cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.network_security_group_group, virtualnetwork_cli.security_rule_group, "rules")

cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.security_rule_group, virtualnetwork_cli.list_network_security_group_security_rules, "list")
cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.security_rule_group, virtualnetwork_cli.update_network_security_group_security_rules, "update")

# help for oci network ip-sec-connection create --static-routes
network_create_ip_sec_connection_static_routes_example = """'["10.0.0.0/16"]'"""
network_create_ip_sec_connection_static_routes_help = """Static routes to the CPE. At least one route must be included. The CIDR must not be a multicast address or class E address. This must be provided in JSON format."""
cli_util.update_param_help(virtualnetwork_cli.create_ip_sec_connection, 'static_routes', network_create_ip_sec_connection_static_routes_help, append=False, example=network_create_ip_sec_connection_static_routes_example)

network_create_subnet_prohibit_public_ip_on_vnic_help = """Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch (with the `--assign-public-ip` flag). If `--prohibit-public-ip-on-vnic` is set to true, VNICs created in this subnet cannot have public IP addresses (i.e., it's a private subnet)."""
network_create_subnet_prohibit_public_ip_on_vnic_example = "`true`"
cli_util.update_param_help(virtualnetwork_cli.create_subnet, 'prohibit_public_ip_on_vnic', network_create_subnet_prohibit_public_ip_on_vnic_help, example=network_create_subnet_prohibit_public_ip_on_vnic_example)

# help for oci network subnet create --security-list-ids
security_list_example_id = 'ocid1.securitylist.oc1.phx.aaaaaaaadyndu2n3hcmdsjfiljwyq7vpxsvv7ynp4ori7aealcvhzicnzhyq'
network_create_subnet_security_list_ids_example = """'["{sl_id}"]'"""
cli_util.update_param_help(virtualnetwork_cli.create_subnet, 'security_list_ids', '', append=True, example=network_create_subnet_security_list_ids_example.format(sl_id=security_list_example_id))

# help for oci network dhcp-options create --options
network_create_dhcp_options_options_example = """'[{"type": "DomainNameServer", "customDnsServers": ["202.44.61.9"], "serverType": "CustomDnsServer"}]'"""
cli_util.update_param_help(virtualnetwork_cli.create_dhcp_options, 'options', '', append=True, example=network_create_dhcp_options_options_example)
cli_util.update_param_help(virtualnetwork_cli.update_dhcp_options, 'options', '', append=True, example=network_create_dhcp_options_options_example)
Beispiel #4
0
compute_cli.boot_volume_attachment_group.add_command(
    compute_cli.detach_boot_volume)

# help for oci compute instance launch --metadata
compute_instance_launch_metadata_example = """'{"ssh_authorized_keys": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbVpuGODmhsRZOLWNgm0aEYUoWIDSPNWHmg2M6mZpmZNHfiNfx2dSofxUpKOiu5S8Th52AuAHSmkzNe6lXBO9wxnjOvkowe1mAleRTEl8zPI8Jkz6HrmJCzHEtS04kC4bx+tXRZhIfRq1uGaPcriKyquTnQs52Ahoxgw5vdXXQMwxWZLAcyaP01JrZwcUqPlB/GRiBFSTj0E/AIiVW3APNME5HjreOd/djjPRpvWu7AUpOqskG38kr8lhxo1hJifqeMg5W7cQsecTLJHgTDAPJD68ujM93jdzV2llIXwR1zyl80i6c3lDLyLgUrCLM0R1xex/zITTdT6/Z84buS/Xl my public key"}'"""
compute_instance_launch_metadata_help = """Custom metadata key/value pairs that you provide, such as the SSH public key required to connect to the instance. For more info see documentation: https://docs.cloud.oracle.com/api/#/en/iaas/20160918/requests/LaunchInstanceDetails. This must be provided in JSON format.

Note: user_data and ssh_authorized_keys can instead be specified using the parameters --user-data-file and --ssh-authorized-keys-file."""

compute_instance_launch_subnet_id_help = """The OCID of the subnet where the VNIC attached to this instance will be created."""
compute_instance_launch_hostname_label_help = """The hostname for the VNIC that is created during instance launch. Used for DNS. The value is the hostname portion of the instance's fully qualified domain name (FQDN) (e.g., `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). Must be unique across all VNICs in the subnet and comply with [RFC 952] and [RFC 1123]. The value cannot be changed, and it can be retrieved from the [Vnic].

For more information, see [DNS in Your Virtual Cloud Network]."""
cli_util.update_param_help(compute_cli.launch_instance,
                           'metadata',
                           compute_instance_launch_metadata_help,
                           append=False,
                           example=compute_instance_launch_metadata_example)
cli_util.update_param_help(compute_cli.launch_instance, 'subnet_id',
                           compute_instance_launch_subnet_id_help)
cli_util.update_param_help(compute_cli.launch_instance,
                           'hostname_label',
                           compute_instance_launch_hostname_label_help,
                           example='`bminstance-1`')
cli_util.update_param_help(
    compute_cli.launch_instance, 'source_details',
    """Use this parameter to specify whether a boot volume or an image should be used to launch a new instance."""
    + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
cli_util.update_param_help(
    compute_cli.launch_instance,
    'image_id',
cli_util.rename_command(audit_cli.audit_root_group,
                        audit_cli.audit_event_group, "event")
audit_cli.configuration_group.commands.pop(audit_cli.update_configuration.name)
audit_cli.audit_event_group.commands.pop(audit_cli.list_events.name)

cli_util.get_param(
    audit_cli.list_events,
    'start_time').type = custom_types.CLI_DATETIME_ROUNDED_MINUTE
cli_util.get_param(audit_cli.list_events,
                   'end_time').type = custom_types.CLI_DATETIME_ROUNDED_MINUTE

audit_start_time_help = """Returns events that were processed at or after this start date and time. For example, a start value of `2017-01-15T11:30:00Z` will retrieve a list of all events processed since 30 minutes after the 11th hour of January 15, 2017, in Coordinated Universal Time (UTC).
You can specify a value with granularity to the minute. If seconds are provided then this will be rounded to the nearest minute, with greater than or equal to 30 seconds rounding up and less than 30 seconds rounding down.
""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE
cli_util.update_param_help(audit_cli.list_events,
                           'start_time',
                           audit_start_time_help,
                           append=False)
audit_end_time_help = """Returns events that were processed before this end date and time. For example, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-01-02T00:00:00Z` will retrieve a list of all events processed on January 1, 2017. Similarly, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-02-01T00:00:00Z` will result in a list of all events processed between January 1, 2017 and January 31, 2017.
You can specify a value with granularity to the minute. If seconds are provided then this will be rounded to the nearest minute, with greater than or equal to 30 seconds rounding up and less than 30 seconds rounding down.
""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE
cli_util.update_param_help(audit_cli.list_events,
                           'end_time',
                           audit_end_time_help,
                           append=False)


@cli_util.copy_params_from_generated_command(audit_cli.update_configuration,
                                             params_to_exclude=[
                                                 'wait_for_state',
                                                 'max_wait_seconds',
                                                 'wait_interval_seconds'
Beispiel #6
0
from oci_cli import custom_types
from oci_cli import json_skeleton_utils
import click

# Make sure these commands don't have the "--all-pages" option.
# oci oce oce-instance list --compartment-id, --all-pages, --display-name
# oci oce work-request list --compartment-id, --all-pages, --resource-id
# oci oce work-request-error list --work-request-id, --all-pages
# oci oce work-request-log-entry list --work-request-id, --all-pages
oceinstance_cli.oce_root_group.short_help = "Oracle Content and Experience"
oceinstance_cli.oce_instance_group.commands.pop(oceinstance_cli.list_oce_instances.name)
oceinstance_cli.work_request_group.commands.pop(oceinstance_cli.list_work_requests.name)
oceinstance_cli.work_request_error_group.commands.pop(oceinstance_cli.list_work_request_errors.name)
oceinstance_cli.work_request_log_entry_group.commands.pop(oceinstance_cli.list_work_request_logs.name)

cli_util.update_param_help(oceinstance_cli.create_oce_instance, 'identity_stripe', """Details of the identity stripe used for OceInstance, including name of the Identity Cloud Service instance in my services to be used and value of the Identity Cloud Service tenancy. Example: `{\"serviceName\": \"secondstripe\"; \"tenancy\": \"idcs-8416ebdd0d674f84803f4193cce026e9\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)


@cli_util.copy_params_from_generated_command(oceinstance_cli.list_oce_instances, params_to_exclude=['all', 'all_pages'])
@oceinstance_cli.oce_instance_group.command(name='list', help=oceinstance_cli.list_oce_instances.help)
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'oce', 'class': 'list[OceInstanceSummary]'})
@cli_util.wrap_exceptions
def list_oce_instances(ctx, **kwargs):
    ctx.invoke(oceinstance_cli.list_oce_instances, **kwargs)


@cli_util.copy_params_from_generated_command(oceinstance_cli.list_work_requests, params_to_exclude=['all', 'all_pages'])
@oceinstance_cli.work_request_group.command(name='list', help=oceinstance_cli.list_work_requests.help)
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'oce', 'class': 'list[WorkRequest]'})
Beispiel #7
0
from services.streaming.src.oci_cli_stream.generated import stream_cli
from services.streaming.src.oci_cli_stream_admin.generated import streamadmin_cli
from services.streaming.src.oci_cli_streaming.generated import streaming_service_cli
from oci_cli import cli_util
from oci_cli import custom_types

cli_util.rename_command(streamadmin_cli,
                        streaming_service_cli.streaming_service_group,
                        streamadmin_cli.stream_admin_root_group, "admin")
cli_util.rename_command(stream_cli, stream_cli.cursor_group,
                        stream_cli.create_cursor, "create-cursor")
cli_util.rename_command(stream_cli, stream_cli.cursor_group,
                        stream_cli.create_group_cursor, "create-group-cursor")
cli_util.rename_command(stream_cli, stream_cli.group_group,
                        stream_cli.consumer_heartbeat, "heartbeat")
cli_util.rename_command(stream_cli, stream_cli.group_group,
                        stream_cli.consumer_commit, "commit")

# override help text that is not provided
cli_util.override_command_short_help_and_help(stream_cli.stream_root_group,
                                              "Stream operations")
cli_util.override_command_short_help_and_help(
    streamadmin_cli.stream_admin_root_group,
    "Admin operations for streaming service")
cli_util.update_param_help(
    stream_cli.put_messages, 'messages',
    """The array of messages to put into a stream. Must be Base64 encoded.""" +
    custom_types.cli_complex_type.COMPLEX_TYPE_HELP)

cli_util.SERVICES_REQUIRING_ENDPOINTS.append("stream")