Пример #1
0
def dropdownQuery():
    if request.method == 'GET':
        dropdown_json = {}
        # Regions
        oci_regions = OCIRegions()
        dropdown_json["regions"] = sorted(oci_regions.list(),
                                          key=lambda k: k['name'])
        # Services
        oci_services = OCIServices()
        dropdown_json["services"] = sorted(oci_services.list(),
                                           key=lambda k: k['name'])
        # Instance Shapes
        oci_shapes = OCIShapes()
        dropdown_json["shapes"] = sorted(oci_shapes.list(),
                                         key=lambda k: k['sort_key'])
        # Instance Images
        oci_images = OCIImages()
        dropdown_json["images"] = sorted(oci_images.list(),
                                         key=lambda k: k['sort_key'])
        # Database System Shapes
        db_system_shapes = OCIDatabaseSystemShapes()
        dropdown_json["db_system_shapes"] = sorted(db_system_shapes.list(),
                                                   key=lambda k: k['shape'])
        # Database Versions
        db_versions = OCIDatabaseVersions()
        dropdown_json["db_versions"] = sorted(db_versions.list(),
                                              key=lambda k: k['version'])
        # CPE Device Shapes
        cpe_device_shapes = OCICpeDeviceShapes()
        dropdown_json["cpe_device_shapes"] = sorted(
            cpe_device_shapes.list(),
            key=lambda k: k['cpe_device_info']['vendor'])
        # Fast Connect Provider Services
        fast_connect_provider_services = OCIFastConnectProviderServices()
        dropdown_json["fast_connect_provider_services"] = sorted(
            fast_connect_provider_services.list(),
            key=lambda k: k['provider_name'])
        # MySQL Shapes
        mysql_shapes = OCIMySQLShapes()
        dropdown_json["mysql_shapes"] = sorted(mysql_shapes.list(),
                                               key=lambda k: k['name'])
        # Database Versions
        mysql_versions = OCIMySQLVersions()
        dropdown_json["mysql_versions"] = sorted(
            mysql_versions.list(), key=lambda k: k['version_family'])
        # MySQL Configurations
        mysql_configurations = OCIMySQLConfigurations()
        dropdown_json["mysql_configurations"] = sorted(
            mysql_configurations.list(), key=lambda k: k['display_name'])
        # Instance Shapes
        oci_loadbalancer_shapes = OCILoadBalancerShapes()
        dropdown_json["loadbalancer_shapes"] = sorted(
            oci_loadbalancer_shapes.list(), key=lambda k: k['name'])
        # Kubernetes Versions
        k8_versions = OCIKubernetesVersions()
        dropdown_json["kubernetes_versions"] = sorted(
            k8_versions.list(), key=lambda k: k['version'], reverse=True)
        return dropdown_json
    else:
        return 'Unknown Method', 500
Пример #2
0
def dropdownQuery():
    if request.method == 'GET':
        dropdown_json = {}
        oci_shapes = OCIShapes()
        dropdown_json["shapes"] = sorted(oci_shapes.list(), key=lambda k: k['sort_key'])
        db_system_shapes = OCIDatabaseSystemShapes()
        dropdown_json["db_system_shapes"] = sorted(db_system_shapes.list(), key=lambda k: k['shape'])
        db_versions = OCIDatabaseVersions()
        dropdown_json["db_versions"] = sorted(db_versions.list(), key=lambda k: k['version'])
        oci_images = OCIImages()
        dropdown_json["images"] = sorted(oci_images.list(), key=lambda k: k['sort_key'])
        return dropdown_json
    else:
        return 'Unknown Method', 500
Пример #3
0
def dropdownQuery():
    if request.method == 'GET':
        dropdown_json = {}
        # Regions
        oci_regions = OCIRegions()
        dropdown_json["regions"] = sorted(oci_regions.list(),
                                          key=lambda k: k['name'])
        # Services
        oci_services = OCIServices()
        dropdown_json["services"] = sorted(oci_services.list(),
                                           key=lambda k: k['name'])
        # Instance Shapes
        oci_shapes = OCIShapes()
        dropdown_json["shapes"] = sorted(oci_shapes.list(),
                                         key=lambda k: k['sort_key'])
        # Instance Images
        oci_images = OCIImages()
        dropdown_json["images"] = sorted(oci_images.list(),
                                         key=lambda k: k['sort_key'])
        # Database System Shapes
        db_system_shapes = OCIDatabaseSystemShapes()
        dropdown_json["db_system_shapes"] = sorted(db_system_shapes.list(),
                                                   key=lambda k: k['shape'])
        # Database Versions
        db_versions = OCIDatabaseVersions()
        dropdown_json["db_versions"] = sorted(db_versions.list(),
                                              key=lambda k: k['version'])
        # CPE Device Shapes
        # TODO: Upgrade OCI Python Module
        #cpe_device_shapes = OCICpeDeviceShapes()
        #dropdown_json["cpe_device_shapes"] = sorted(cpe_device_shapes.list(), key=lambda k: k['cpe_device_info']['vendor'])
        # Fast Connect Provider Services
        fast_connect_provider_services = OCIFastConnectProviderServices()
        dropdown_json["fast_connect_provider_services"] = sorted(
            fast_connect_provider_services.list(),
            key=lambda k: k['provider_name'])
        return dropdown_json
    else:
        return 'Unknown Method', 500