def transform(command_help_override_list=[],
               group_help_override_list=[],
               rename_command_list=[],
               relocate_command_list=[],
               pop_command_list=[]):
     for item in command_help_override_list:
         cli_util.override_command_short_help_and_help(
             item["command"], item["help_text"])
     for item in group_help_override_list:
         item["group"].help = item["help_text"]
         item["group"].short_help = item["short_help_text"]
     for item in rename_command_list:
         cli_util.rename_command(item["group"], item["old"], item["new"])
     for item in relocate_command_list:
         item["group"].add_command(item["command"])
     for item in pop_command_list:
         item["group"].commands.pop(item["command"])
Exemple #2
0
cli_util.rename_command(kmsmanagement_cli, kms_service_cli.kms_service_group, kmsmanagement_cli.kms_management_root_group, "management")

cli_util.rename_command(kmsmanagement_cli, kmsmanagement_cli.key_version_group, kmsmanagement_cli.cancel_key_version_deletion, 'cancel-deletion')
cli_util.rename_command(kmsmanagement_cli, kmsmanagement_cli.key_version_group, kmsmanagement_cli.schedule_key_version_deletion, 'schedule-deletion')
cli_util.rename_command(kmsvault_cli, kmsvault_cli.vault_group, kmsvault_cli.vault_usage_group, "usage")

# remove one nested layer from crypto commands (e.g. kms crypto encrypted-data encrypt -> kms crypto encrypt)
kmscrypto_cli.kms_crypto_root_group.commands.pop(kmscrypto_cli.encrypted_data_group.name)
kmscrypto_cli.kms_crypto_root_group.commands.pop(kmscrypto_cli.decrypted_data_group.name)
kmscrypto_cli.kms_crypto_root_group.commands.pop(kmscrypto_cli.generated_key_group.name)
kmscrypto_cli.kms_crypto_root_group.add_command(kmscrypto_cli.decrypt)
kmscrypto_cli.kms_crypto_root_group.add_command(kmscrypto_cli.encrypt)
kmscrypto_cli.kms_crypto_root_group.add_command(kmscrypto_cli.generate_data_encryption_key)

# override help text that is not provided
cli_util.override_command_short_help_and_help(kmsmanagement_cli.key_group, "Source of cryptographic material used to encrypt and decrypt data")
cli_util.override_command_short_help_and_help(kmsmanagement_cli.key_version_group, "A specific version of a Key. Each master encryption key is automatically assigned a key version")
cli_util.override_command_short_help_and_help(kmsvault_cli.vault_group, "A logical entity where Key Management creates and stores your keys")

cli_util.override_command_short_help_and_help(kmsmanagement_cli.kms_management_root_group, "Operations for managing keys and vaults.")
cli_util.override_command_short_help_and_help(kmscrypto_cli.kms_crypto_root_group, "Operations for performing data encryption, decryption and generation of data encryption keys.")
cli_util.override_command_short_help_and_help(kms_service_cli.kms_service_group, "Key Management Service")

cli_util.rename_command(kmsmanagement_cli, kmsmanagement_cli.key_group, kmsmanagement_cli.schedule_key_deletion, "schedule-deletion")
cli_util.rename_command(kmsmanagement_cli, kmsmanagement_cli.key_group, kmsmanagement_cli.cancel_key_deletion, "cancel-deletion")

# TODO: Potentially integrate with a specific --vault-endpoint parameter or find a way to translate a vault
# (e.g. a vault's OCID) to the relevant endpoint
cli_util.SERVICES_REQUIRING_ENDPOINTS.append("kms_crypto")
cli_util.SERVICES_REQUIRING_ENDPOINTS.append("kms_management")
import click

cli_util.rename_command(resourcesearch_cli,
                        resourcesearch_cli.search_root_group,
                        resourcesearch_cli.resource_summary_group, "resource")
cli_util.rename_command(
    resourcesearch_cli, resourcesearch_cli.resource_summary_group,
    resourcesearch_cli.search_resources_free_text_search_details,
    "free-text-search")
cli_util.rename_command(
    resourcesearch_cli, resourcesearch_cli.resource_summary_group,
    resourcesearch_cli.search_resources_structured_search_details,
    "structured-search")

cli_util.override_command_short_help_and_help(
    resourcesearch_cli.search_resources_free_text_search_details,
    "Queries any and all compartments in the tenancy to find resources that match the specified criteria. A free text search includes a request containing arbitrary text that must be present in the resource. Results include resources that you have permission to view and can span different resource types. You can also sort results based on a specified resource attribute."
)

resourcesearch_cli.resource_summary_group.commands.pop(
    resourcesearch_cli.search_resources.name)
resourcesearch_cli.resource_summary_group.commands.pop(
    resourcesearch_cli.search_resources_structured_search_details.name)


@cli_util.copy_params_from_generated_command(
    resourcesearch_cli.search_resources_structured_search_details,
    params_to_exclude=['query_parameterconflict'])
@resourcesearch_cli.resource_summary_group.command(
    name='structured-search',
    help=
    """Queries any and all compartments in the tenancy to find resources that match the specified criteria. A structured search includes a request that uses Search's structured query language to specify query conditions that the resource must meet. For information about using structured queries, see Search Language Syntax in the Oracle Cloud Infrastructure User Guide. Results include resources that you have permission to view and can span different resource types. You can also sort results based on a specified resource attribute."""
Exemple #4
0
# coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

import click
from oci_cli import cli_util
from oci_cli import json_skeleton_utils
from oci_cli.aliasing import CommandGroupWithAlias
from services.nosql.src.oci_cli_nosql.generated import nosql_cli

# Override the name of the service for top-level index
nosql_cli.nosql_root_group.short_help = "NoSQL Database"

# Override help for the table group
cli_util.override_command_short_help_and_help(nosql_cli.table_group, "NoSQL tables")

# Override help for query group
cli_util.override_command_short_help_and_help(nosql_cli.query_result_collection_group, "Queries on table contents")

# oci nosql query-result-collection ... -> oci nosql query ...
# oci nosql query prepare-statement -> oci nosql query prepare
cli_util.rename_command(nosql_cli, nosql_cli.nosql_root_group, nosql_cli.query_result_collection_group, "query")
cli_util.rename_command(nosql_cli, nosql_cli.query_result_collection_group, nosql_cli.prepare_statement, "prepare")

# oci nosql query-result-collection summarize-statement -> removed
nosql_cli.query_result_collection_group.commands.pop("summarize-statement")
nosql_cli.query_result_collection_group.commands.pop("query")

# Override help for workrequest group
cli_util.override_command_short_help_and_help(nosql_cli.work_request_group, "Monitoring of async operations")
Exemple #5
0
# coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

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

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.SERVICES_REQUIRING_ENDPOINTS.append("stream")
patch_get_group.add_command(database_cli.get_db_system_patch)
patch_list_group.add_command(database_cli.list_db_system_patches)

database_cli.patch_history_entry_group.commands.pop(
    database_cli.get_db_home_patch_history_entry.name)
database_cli.patch_history_entry_group.commands.pop(
    database_cli.list_db_home_patch_history_entries.name)

patch_history_get_group.add_command(
    database_cli.get_db_system_patch_history_entry)
patch_history_list_group.add_command(
    database_cli.list_db_system_patch_history_entries)

cli_util.override_command_short_help_and_help(
    database_cli.backup_group,
    """A database backup. To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies]."""
)
cli_util.override_command_short_help_and_help(
    database_cli.data_guard_association_group,
    """The properties that define a Data Guard association.
To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies].
For information about endpoints and signing API requests, see [About the API]. For information about available SDKs and tools, see [SDKS and Other Tools]."""
)
cli_util.override_command_short_help_and_help(
    database_cli.database_group,
    """An Oracle database on a bare metal or virtual machine DB system. For more information, see Bare Metal and Virtual Machine DB Systems.
To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies].
**Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API."""
)
cli_util.override_command_short_help_and_help(
    database_cli.db_node_group,