Ejemplo n.º 1
0
import setup_pyAMI
 # the above line needed to ensure correct python environment since pyAMI 4.0.3
from pyAMI import endpoint
from pyAMI.client import AMIClient
from pyAMI.endpoint import get_endpoint,get_XSL_URL
from pyAMI.auth import AMI_CONFIG, create_auth_config
import os
# set up your arguments for your favourite command
argv=[]
argv.append("GetUserInfo")
# the following will fail on the replica but succeed on the main, because the replica is case sensitive!
argv.append("amiLogin=ALBRAND")
#to use the replica
endpoint.TYPE = 'replica'
print get_endpoint()
print get_XSL_URL()
amiClient = AMIClient()
# Read the config file of username and password.
# prompt if it is not there
if not os.path.exists(AMI_CONFIG):
   create_auth_config()
amiClient.read_config(AMI_CONFIG)

try:
   result=amiClient.execute(argv)
   print "Reading from the CERN replica: "+result.output("xml")
except Exception, msg:
   error = str(msg)
   print error
   endpoint.TYPE = 'main'
   try:
Ejemplo n.º 2
0
    def getAMISecureWebServiceAddress(self):

        return endpoint.get_endpoint()
Ejemplo n.º 3
0
    def getAMISecureWebService(self, url=None, **kw):

        return AMISecureWebServiceSoapBindingSOAP(
                url or endpoint.get_endpoint(), **kw)
Ejemplo n.º 4
0
class execAMICommandRequest:

    typecode = _execAMICommandRequestTypecode
    __metaclass__ = pyclass_type

    def __init__(self):

        self._confArgs = None
        self._args = None
        return

execAMICommandRequest.typecode.pyclass = execAMICommandRequest

_execAMICommandResponseTypecode = Struct(
        pname=(endpoint.get_endpoint(), "execAMICommandResponse"),
        ofwhat=[ZSI.TC.String(pname="execAMICommandReturn",
            aname="_execAMICommandReturn", typed=False, encoded=None,
            minOccurs=1, maxOccurs=1, nillable=True)],
        pyclass=None, encoded=endpoint.get_endpoint())

class execAMICommandResponse:

    typecode = _execAMICommandResponseTypecode
    __metaclass__ = pyclass_type

    def __init__(self):

        self._execAMICommandReturn = None
        return