# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
load_balancer_client = oci.load_balancer.LoadBalancerClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_load_balancer_response = load_balancer_client.create_load_balancer(
    create_load_balancer_details=oci.load_balancer.models.CreateLoadBalancerDetails(
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        display_name="EXAMPLE-displayName-Value",
        shape_name="EXAMPLE-shapeName-Value",
        subnet_ids=["EXAMPLE--Value"],
        shape_details=oci.load_balancer.models.ShapeDetails(
            minimum_bandwidth_in_mbps=609,
            maximum_bandwidth_in_mbps=318),
        is_private=True,
        ip_mode="IPV4",
        reserved_ips=[
                oci.load_balancer.models.ReservedIP(
                    id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")],
        listeners={
            'EXAMPLE_KEY_ZY7z3': {
                'defaultBackendSetName': 'EXAMPLE-defaultBackendSetName-Value',
                'port': 481,
                'protocol': 'EXAMPLE-protocol-Value',
                            'hostnameNames': ['EXAMPLE--Value'],
                            'pathRouteSetName': 'EXAMPLE-pathRouteSetName-Value',
                            'sslConfiguration': {
                                'verifyDepth': 991,
                                'verifyPeerCertificate': False,
                                'certificateName': 'EXAMPLE-certificateName-Value',
                                'protocols': ['EXAMPLE--Value'],
                                'cipherSuiteName': 'EXAMPLE-cipherSuiteName-Value',
                                'serverOrderPreference': 'DISABLED'},
                            'connectionConfiguration': {
                                'idleTimeout': 957,
                                'backendTcpProxyProtocolVersion': 945},
                            'routingPolicyName': 'EXAMPLE-routingPolicyName-Value',
                            'ruleSetNames': ['EXAMPLE--Value']}},
        hostnames={
            'EXAMPLE_KEY_UiTU7': {
                'name': 'EXAMPLE-name-Value',
                'hostname': 'EXAMPLE-hostname-Value'}},
        backend_sets={
            'EXAMPLE_KEY_IXlme': {
                'policy': 'EXAMPLE-policy-Value',
                'healthChecker': {
                    'protocol': 'EXAMPLE-protocol-Value',
                    'urlPath': 'EXAMPLE-urlPath-Value',
                    'port': 291,
                    'returnCode': 822,
                    'retries': 340,
                    'timeoutInMillis': 253,
                    'intervalInMillis': 926,
                    'responseBodyRegex': 'EXAMPLE-responseBodyRegex-Value'},
                'backends': [
                    {
                        'ipAddress': 'EXAMPLE-ipAddress-Value',
                        'port': 112,
                        'weight': 680,
                        'backup': False,
                        'drain': False,
                        'offline': False}],
                'sslConfiguration': {
                    'verifyDepth': 275,
                    'verifyPeerCertificate': True,
                    'certificateName': 'EXAMPLE-certificateName-Value',
                    'protocols': ['EXAMPLE--Value'],
                    'cipherSuiteName': 'EXAMPLE-cipherSuiteName-Value',
                    'serverOrderPreference': 'ENABLED'},
                'sessionPersistenceConfiguration': {
                    'cookieName': 'EXAMPLE-cookieName-Value',
                    'disableFallback': False},
                'lbCookieSessionPersistenceConfiguration': {
                    'cookieName': 'EXAMPLE-cookieName-Value',
                    'disableFallback': False,
                    'domain': 'EXAMPLE-domain-Value',
                    'path': 'EXAMPLE-path-Value',
                    'maxAgeInSeconds': 2,
                    'isSecure': False,
                    'isHttpOnly': False}}},
        network_security_group_ids=["EXAMPLE--Value"],
        certificates={
            'EXAMPLE_KEY_UAVG5': {
                'certificateName': 'EXAMPLE-certificateName-Value',
                'passphrase': 'EXAMPLE-passphrase-Value',
                'privateKey': 'EXAMPLE-privateKey-Value',
                'publicCertificate': 'EXAMPLE-publicCertificate-Value',
                'caCertificate': 'EXAMPLE-caCertificate-Value'}},
        ssl_cipher_suites={
            'EXAMPLE_KEY_AKLU0': {
                'name': 'EXAMPLE-name-Value',
                'ciphers': ['EXAMPLE--Value']}},
        path_route_sets={
            'EXAMPLE_KEY_Bei2h': {
                'pathRoutes': [
                    {
                        'path': 'EXAMPLE-path-Value',
                        'pathMatchType': {
                            'matchType': 'PREFIX_MATCH'},
                        'backendSetName': 'EXAMPLE-backendSetName-Value'}]}},
        freeform_tags={
            'EXAMPLE_KEY_AnsZ6': 'EXAMPLE_VALUE_tw151CY5i79t9aWuKn1A'},
        defined_tags={
            'EXAMPLE_KEY_ylOu6': {
                'EXAMPLE_KEY_Fpw66': 'EXAMPLE--Value'}},
        rule_sets={
            'EXAMPLE_KEY_QgD2d': {
                'items': [
                    {
                        'action': 'REMOVE_HTTP_REQUEST_HEADER',
                        'header': 'EXAMPLE-header-Value'}]}}),
    opc_request_id="02ETK2CAYQ1TZPPIRIB3/OpcRequestIdExample/<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(create_load_balancer_response.data)