Changeset 855 for vanHelsing/trunk
- Timestamp:
- Mar 26, 2010, 6:42:38 PM (15 years ago)
- Location:
- vanHelsing/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/src/VanHelsing.wsdl
r839 r855 3 3 <wsdl:types> 4 4 <xsd:schema targetNamespace="http://www.dass-it.de/VanHelsing/"> 5 <xsd:element name="listResources" type="tns:listResourcesType"> 6 </xsd:element> 7 <xsd:element name="listResourcesResponse" type="tns:resourceListType"> 8 </xsd:element> 5 <xsd:element name="listResources" type="tns:listResourcesType"></xsd:element> 6 <xsd:element name="listResourcesResponse" type="tns:resourceListType"></xsd:element> 9 7 <xsd:complexType name="listResourcesType"> 10 8 <xsd:sequence> … … 51 49 </xsd:sequence> 52 50 </xsd:complexType> 51 <xsd:element name="setSimpleResource"> 52 <xsd:complexType> 53 <xsd:sequence> 54 <xsd:element name="resInfo" type="tns:ResourceInfo"></xsd:element> 55 <xsd:element name="resAttribute" type="tns:ResourceAttributeType" maxOccurs="unbounded" minOccurs="0"></xsd:element> 56 </xsd:sequence> 57 </xsd:complexType> 58 </xsd:element> 59 <xsd:element name="setSimpleResourceResponse"> 60 <xsd:complexType> 61 <xsd:sequence> 62 <xsd:element name="resId" type="xsd:int"></xsd:element> 63 <xsd:element name="status" type="xsd:string"></xsd:element> 64 </xsd:sequence> 65 </xsd:complexType> 66 </xsd:element> 53 67 </xsd:schema> 54 68 </wsdl:types> … … 65 79 <wsdl:part name="parameters" element="tns:getSimpleResourceResponse"></wsdl:part> 66 80 </wsdl:message> 81 <wsdl:message name="setSimpleResourceRequest"> 82 <wsdl:part name="newResource" element="tns:setSimpleResource"></wsdl:part> 83 </wsdl:message> 84 <wsdl:message name="setSimpleResourceResponse"> 85 <wsdl:part name="setResponse" element="tns:setSimpleResourceResponse"></wsdl:part> 86 </wsdl:message> 67 87 <wsdl:portType name="VanHelsing"> 88 68 89 <wsdl:operation name="listResources"> 69 90 <wsdl:input message="tns:listResourcesRequest"/> … … 73 94 <wsdl:input message="tns:getSimpleResourceRequest"></wsdl:input> 74 95 <wsdl:output message="tns:getSimpleResourceResponse"></wsdl:output> 96 </wsdl:operation> 97 <wsdl:operation name="setSimpleResource"> 98 <wsdl:input message="tns:setSimpleResourceRequest"></wsdl:input> 99 <wsdl:output message="tns:setSimpleResourceResponse"></wsdl:output> 75 100 </wsdl:operation> 76 101 </wsdl:portType> … … 98 123 </wsdl:output> 99 124 </wsdl:operation> 125 <wsdl:operation name="setSimpleResource"> 126 <soap:operation 127 soapAction="http://www.dass-it.de/VanHelsing/setResource" /> 128 <wsdl:input> 129 <soap:body use="literal" /> 130 </wsdl:input> 131 <wsdl:output> 132 <soap:body use="literal" /> 133 </wsdl:output> 134 </wsdl:operation>l 100 135 </wsdl:binding> 101 136 <wsdl:service name="VanHelsing"> -
vanHelsing/trunk/src/VanHelsingServer.py
r839 r855 79 79 return request,response 80 80 81 def soap_setSimpleResource(self, ps, **kw): 82 request,response=VanHelsing.soap_setSimpleResource(self, ps) 81 83 84 resInfo = request.get_element_resInfo() 85 resId = resInfo.get_element_resId() 86 director = resInfo.get_element_director() 87 attributes = request.get_element_resAttribute() 82 88 89 resId, status = VanHelsingWrapper.setResourceById(resId, director, attributes, resInfo) 90 response.set_element_resId(resId) 91 response.set_element_status(status) 92 93 return request, response 83 94 84 95 if 1: -
vanHelsing/trunk/src/VanHelsingWrapper.py
r839 r855 13 13 password="" 14 14 for a in xrange(0,len): 15 password += random.choice(charset)15 password += random.choice(charset) 16 16 return password 17 17 … … 86 86 def getResourceById(directorName,resId): 87 87 dirdcfg=getDirectorConfig(directorName) 88 return dirdcfg.getRoot().getById(resId) 88 return dirdcfg.getRoot().getById(resId) 89 90 def setResourceById(resId, directorName, attributes, resInfo): 91 if resId > 0: 92 myResource = getResourceById(directorName, resId) 93 myResource.items = [] 94 for a in attributes: 95 k = a.get_element_key() 96 v = a.get_element_value() 97 myResource.add(k, v) 98 99 else: 100 resource = resource.Resource() 101 resource.name = resInfo.get_element_resName() 102 setResourceById(resource.getId, directorName, attributes, resInfo) 103 104 status = "wtf" 105 106 return resId, status 89 107 90 108 def getResourceByName(directorName,resType,name): … … 103 121 clientIds=getResources("bacula-dir","Client") 104 122 105 c=getResourceById("bacula-dir",clientIds[0][0]) 106 print c 107 print keyValueList(c) 108 123 #c=getResourceById("bacula-dir",clientIds[0][0]) 124 #print c 125 #print keyValueList(c) 126 attList = [("name", "klaus"), ("director", "bernd"), ("FileSet","homeAll")] 127 resId, status = setResourceById(100, "bacula-dir", attList) -
vanHelsing/trunk/src/VanHelsing_server.py
r839 r855 3 3 # 4 4 # skeleton generated by "ZSI.generate.wsdl2dispatch.ServiceModuleWriter" 5 # /usr/ bin/wsdl2py -b VanHelsing.wsdl5 # /usr/local/bin/wsdl2py -b VanHelsing.wsdl 6 6 # 7 7 ################################################## … … 20 20 21 21 getSimpleResourceResponse = GED("http://www.dass-it.de/VanHelsing/", "getSimpleResourceResponse").pyclass 22 23 setSimpleResourceRequest = GED("http://www.dass-it.de/VanHelsing/", "setSimpleResource").pyclass 24 25 setSimpleResourceResponse = GED("http://www.dass-it.de/VanHelsing/", "setSimpleResourceResponse").pyclass 22 26 23 27 … … 44 48 root[(getSimpleResourceRequest.typecode.nspname,getSimpleResourceRequest.typecode.pname)] = 'soap_getSimpleResource' 45 49 50 def soap_setSimpleResource(self, ps, **kw): 51 request = ps.Parse(setSimpleResourceRequest.typecode) 52 return request,setSimpleResourceResponse() 53 54 soapAction['http://www.dass-it.de/VanHelsing/setResource'] = 'soap_setSimpleResource' 55 root[(setSimpleResourceRequest.typecode.nspname,setSimpleResourceRequest.typecode.pname)] = 'soap_setSimpleResource' 56 -
vanHelsing/trunk/src/VanHelsing_types.py
r839 r855 3 3 # 4 4 # schema types generated by "ZSI.generate.wsdl2python.WriteServiceModule" 5 # /usr/ bin/wsdl2py -b VanHelsing.wsdl5 # /usr/local/bin/wsdl2py -b VanHelsing.wsdl 6 6 # 7 7 ################################################## … … 192 192 self.pyclass = Holder 193 193 194 class setSimpleResource_Dec(ZSI.TCcompound.ComplexType, ElementDeclaration): 195 literal = "setSimpleResource" 196 schema = "http://www.dass-it.de/VanHelsing/" 197 def __init__(self, **kw): 198 ns = ns0.setSimpleResource_Dec.schema 199 TClist = [GTD("http://www.dass-it.de/VanHelsing/","ResourceInfo",lazy=False)(pname="resInfo", aname="_resInfo", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.dass-it.de/VanHelsing/","ResourceAttributeType",lazy=False)(pname="resAttribute", aname="_resAttribute", minOccurs=0, maxOccurs="unbounded", nillable=False, typed=False, encoded=kw.get("encoded"))] 200 kw["pname"] = ("http://www.dass-it.de/VanHelsing/","setSimpleResource") 201 kw["aname"] = "_setSimpleResource" 202 self.attribute_typecode_dict = {} 203 ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw) 204 class Holder: 205 __metaclass__ = pyclass_type 206 typecode = self 207 def __init__(self): 208 # pyclass 209 self._resInfo = None 210 self._resAttribute = [] 211 return 212 Holder.__name__ = "setSimpleResource_Holder" 213 self.pyclass = Holder 214 215 class setSimpleResourceResponse_Dec(ZSI.TCcompound.ComplexType, ElementDeclaration): 216 literal = "setSimpleResourceResponse" 217 schema = "http://www.dass-it.de/VanHelsing/" 218 def __init__(self, **kw): 219 ns = ns0.setSimpleResourceResponse_Dec.schema 220 TClist = [ZSI.TCnumbers.Iint(pname="resId", aname="_resId", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="status", aname="_status", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))] 221 kw["pname"] = ("http://www.dass-it.de/VanHelsing/","setSimpleResourceResponse") 222 kw["aname"] = "_setSimpleResourceResponse" 223 self.attribute_typecode_dict = {} 224 ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw) 225 class Holder: 226 __metaclass__ = pyclass_type 227 typecode = self 228 def __init__(self): 229 # pyclass 230 self._resId = None 231 self._status = None 232 return 233 Holder.__name__ = "setSimpleResourceResponse_Holder" 234 self.pyclass = Holder 235 194 236 # end class ns0 (tns: http://www.dass-it.de/VanHelsing/)
Note:
See TracChangeset
for help on using the changeset viewer.