Exemplo n.º 1
0
Arquivo: rest.py Projeto: nuaays/argo
def axmon_create_managed_elb():
    """
    Post data is of the following format
    {
        name: name of elb (32 chars)
        application: name of application
        deployment: name of deployment
        deployment_selector: {
            'key1': 'value1',
            'key2: 'value2'
        }
        type: internal/external
        ports: [ an array of PortSpec ]

        PortSpec {
            listen_port: listen on port number
            container_port: container port to forward to
            protocol: tcp/ssl/http/https
            certificate: (optional) only needed if type is ssl/https
        }

        }
    }

    Returns:
        { result: The dns name of the managed elb }
    """
    data = request.get_json()
    (name, application, deployment, deployment_selector, type, ports, ) = _get_required_arguments('name', 'application', 'deployment', 'deployment_selector', 'type', 'ports')
    elb = ManagedElb(name)
    dnsname = elb.create(application, deployment, ports, False if type == "external" else True, labels=deployment_selector)
    return jsonify(result=dnsname)
Exemplo n.º 2
0
    def _clean_up_argo_specific_cloud_infrastructure(self):
        """
        This step cleans up components in cloud provider that are specifically needed by
        Argo cluster, including:
            - Buckets (everything under this cluster's directory)
            - Server certificates
        :return:
        """
        logger.info(
            "Cluster uninstall step: Clean Up Argo-specific Infrastructure")
        AXClusterBuckets(self._name_id, self._cfg.cloud_profile,
                         self._cfg.cloud_region).delete()

        # Delete server certificates: This code is deleting the default server certificates created
        # by public and private elb. Since server certs cannot be tagged, we need to delete them this way.
        certname = ManagedElb.get_elb_name(self._name_id, "ing-pub")
        delete_server_certificate(self._cfg.cloud_profile, certname)
        certname = ManagedElb.get_elb_name(self._name_id, "ing-pri")
        delete_server_certificate(self._cfg.cloud_profile, certname)
Exemplo n.º 3
0
Arquivo: rest.py Projeto: nuaays/argo
def axmon_list_managed_elb():
    return jsonify(result=ManagedElb.list_all())
Exemplo n.º 4
0
Arquivo: rest.py Projeto: nuaays/argo
def axmon_delete_managed_elb(elb_name):
    elb = ManagedElb(elb_name)
    elb.delete()
    return jsonify(result="ok")