Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Creates and returns a Nimbus epr file

Arguments:
workspace_id -- The id of the workspace
nimbus_hostname -- The hostname of the Nimbus service

Example:
this function just calls ws_epr, so see it for an example

returns None if input is invalid

        def ws_epr_factory(workspace_id, nimbus_hostname, nimbus_port=8443):
    """
    Creates and returns a Nimbus epr file

    Arguments:
    workspace_id -- The id of the workspace
    nimbus_hostname -- The hostname of the Nimbus service

    Example:
    this function just calls ws_epr, so see it for an example

    returns None if input is invalid
    """

    (xml_out, file_name) = tempfile.mkstemp()

    epr_xml = ws_epr(workspace_id, nimbus_hostname, nimbus_port)

    if epr_xml != None:

        os.write(xml_out, ws_epr(workspace_id, nimbus_hostname, nimbus_port))
        os.close(xml_out)

        # Return the filename of the created metadata file
        return file_name
    else:
        return none
        


src/c/l/cloud-scheduler-1.6/cloudscheduler/nimbuscluster.py   cloud-scheduler(Download)
 
        # Create an epr for workspace.sh
        vm_epr = nimbus_xml.ws_epr_factory(vm.id, vm.clusteraddr, vm.clusterport)
        if vm.clusteraddr != self.network_address:
            log.error("Attempting to destroy a VM on wrong cluster - vm belongs to %s, but this is %s. Abort" % (vm.clusteraddr, self.networ_address))
        special_status = ("Retiring", "TempBanned", "HeldBadReqs", "HTTPFail, BrokenPipe")
        # Create an epr for our poll command
        vm_epr = nimbus_xml.ws_epr_factory(vm.id, vm.clusteraddr, vm.clusterport)
 
        # Create workspace poll command

src/c/l/cloud-scheduler-HEAD/cloudscheduler/nimbuscluster.py   cloud-scheduler(Download)
 
        # Create an epr for workspace.sh
        vm_epr = nimbus_xml.ws_epr_factory(vm.id, vm.clusteraddr, vm.clusterport)
        if vm.clusteraddr != self.network_address:
            log.error("Attempting to destroy a VM on wrong cluster - vm belongs to %s, but this is %s. Abort" % (vm.clusteraddr, self.networ_address))
        special_status = ("Retiring", "TempBanned", "HeldBadReqs", "HTTPFail, BrokenPipe")
        # Create an epr for our poll command
        vm_epr = nimbus_xml.ws_epr_factory(vm.id, vm.clusteraddr, vm.clusterport)
 
        # Create workspace poll command