Esempio n. 1
0
def set_service_extract_flags(cmd):

    prm = ShowOCIFlags()

    prm.showoci_version = version

    if cmd.proxy:
        prm.proxy = cmd.proxy

    if cmd.mgdcompart:
        prm.read_ManagedCompartmentForPaaS = False

    if cmd.all or cmd.identity:
        prm.read_identity = True

    if cmd.all or cmd.allnoiam or cmd.network:
        prm.read_network = True

    if cmd.all or cmd.allnoiam or cmd.compute:
        prm.read_compute = True

    if cmd.all or cmd.allnoiam or cmd.database:
        prm.read_database = True

    if cmd.all or cmd.allnoiam or cmd.file:
        prm.read_file_storage = True

    if cmd.all or cmd.allnoiam or cmd.object:
        prm.read_object_storage = True

    if cmd.all or cmd.allnoiam or cmd.orm:
        prm.read_resource_management = True

    if cmd.all or cmd.allnoiam or cmd.load:
        prm.read_load_balancer = True

    if cmd.all or cmd.allnoiam or cmd.email:
        prm.read_email_distribution = True

    if cmd.all or cmd.allnoiam or cmd.container:
        prm.read_containers = True

    if cmd.all or cmd.allnoiam or cmd.streams:
        prm.read_streams = True

    if cmd.all or cmd.allnoiam or cmd.budgets:
        prm.read_budgets = True

    if cmd.all or cmd.allnoiam or cmd.function:
        prm.read_function = True

    if cmd.all or cmd.allnoiam or cmd.api:
        prm.read_api = True

    if cmd.all or cmd.allnoiam or cmd.limits:
        prm.read_limits = True

    if cmd.all or cmd.allnoiam or cmd.paas_native:
        prm.read_paas_native = True

    if cmd.all or cmd.allnoiam or cmd.data_ai:
        prm.read_data_ai = True

    if cmd.all or cmd.allnoiam or cmd.monitoring:
        prm.read_monitoring_notifications = True

    if cmd.all or cmd.allnoiam or cmd.announcement:
        prm.read_announcement = True

    if cmd.all or cmd.allnoiam or cmd.edge:
        prm.read_edge = True

    if cmd.all or cmd.allnoiam or cmd.security:
        prm.read_security = True

    if cmd.noroot:
        prm.read_root_compartment = False

    if cmd.skip_backups:
        prm.skip_backups = True

    if cmd.config:
        if cmd.config.name:
            prm.config_file = cmd.config.name

    if cmd.profile:
        prm.config_section = cmd.profile

    if cmd.region:
        prm.filter_by_region = str(cmd.region)

    if cmd.compart:
        prm.filter_by_compartment = str(cmd.compart)

    if cmd.compart_recur:
        prm.filter_by_compartment_recursive = str(cmd.compart_recur)

    if cmd.compartpath:
        prm.filter_by_compartment_path = str(cmd.compartpath)

    if cmd.instance_principals:
        prm.use_instance_principals = True

    if cmd.delegation_token:
        prm.use_delegation_token = True

    if cmd.skip_identity_user_credential:
        prm.skip_identity_user_credential = True

    if cmd.tenantid:
        prm.filter_by_tenancy_id = cmd.tenantid

    return prm
Esempio n. 2
0
def set_service_extract_flags(cmd):

    prm = ShowOCIFlags()

    prm.showoci_version = version

    if cmd.proxy:
        prm.proxy = cmd.proxy

    if cmd.mgdcompart:
        prm.read_ManagedCompartmentForPaaS = False

    if cmd.all or cmd.identity:
        prm.read_identity = True

    if cmd.all or cmd.allnoiam or cmd.network:
        prm.read_network = True

    if cmd.all or cmd.allnoiam or cmd.compute:
        prm.read_compute = True

    if cmd.all or cmd.allnoiam or cmd.database:
        prm.read_database = True

    if cmd.all or cmd.allnoiam or cmd.file:
        prm.read_file_storage = True

    if cmd.all or cmd.allnoiam or cmd.object:
        prm.read_object_storage = True

    if cmd.all or cmd.allnoiam or cmd.orm:
        prm.read_resource_management = True

    if cmd.all or cmd.allnoiam or cmd.load:
        prm.read_load_balancer = True

    if cmd.all or cmd.allnoiam or cmd.email:
        prm.read_email_distribution = True

    if cmd.all or cmd.allnoiam or cmd.container:
        prm.read_containers = True

    if cmd.all or cmd.allnoiam or cmd.streams:
        prm.read_streams = True

    if cmd.all or cmd.allnoiam or cmd.budgets:
        prm.read_budgets = True

    if cmd.all or cmd.allnoiam or cmd.monitoring:
        prm.read_monitoring_notifications = True

    if cmd.all or cmd.allnoiam or cmd.announcement:
        prm.read_announcement = True

    if cmd.all or cmd.allnoiam or cmd.edge:
        prm.read_edge = True

    if cmd.noroot:
        prm.read_root_compartment = False

    if cmd.config:
        if cmd.config.name:
            prm.config_file = cmd.config.name

    if cmd.profile:
        prm.config_section = cmd.profile

    if cmd.region:
        prm.filter_by_region = str(cmd.region)

    if cmd.compart:
        prm.filter_by_compartment = str(cmd.compart)

    if cmd.instance_principals:
        prm.use_instance_principals = True

    return prm