def delete(self): """ method: gslb.zone.delete Delete the GSLB zone. """ try: method_call.call_api(self, method="gslb.zone.delete", format="json", name=self.name) except AxAPIError, e: return e.code
def update(self): """ method: slb.virtual_server.update Update the virtual server. """ try: method_call.call_api(self, method="slb.virtual_server.update", format="json", post_data=self.getRequestPostDataJson()) return 0 except AxAPIError, e: return e.code
def create(self): """ method: gslb.policy.create Create the GSLB policy. """ try: method_call.call_api(self, method="gslb.policy.create", format="json", post_data=self.getRequestPostDataJson()) return 0 except AxAPIError, e: return e.code
def configure(self): """ method: network.ve.set Configure a ve. """ try: method_call.call_api(self, method="network.ve.set", format="url", post_data=self.getRequestPostDataXml()) return 0 except AxAPIError, e: return e.code
def create(self): """ method: slb.service_group.create Create the service group. """ try: method_call.call_api(self, method="slb.service_group.create", format="json", post_data=self.getRequestPostDataJson()) return 0 except AxAPIError, e: return e.code
def update(self): """ method : gslb.global.set Update GSLB global settings. """ try: method_call.call_api(self, method="gslb.global.set", format="json", post_data=self.getRequestPostDataJson()) return 0 except AxAPIError, e: return e.code
def delete(self): """ method: gslb.snmp_template.delete Delete the GSLB SNMP template. """ try: method_call.call_api(self, method="gslb.snmp_template.delete", format="json", name=self.name) return 0 except AxAPIError, e: return e.code
def update(self): """ method: gslb.snmp_template.update Update the GSLB SNMP template. """ try: method_call.call_api(self, method="gslb.snmp_template.update", format="json", post_data=self.getRequestPostDataJson()) return 0 except AxAPIError, e: return e.code
def delete(self): """ method: slb.service_group.delete Delete the service group. """ try: method_call.call_api(self, method="slb.service_group.delete", format="json", name=self.name) return 0 except AxAPIError, e: return e.code
def delete(self): """ method: gslb.service_ip.delete Delete the GSLB service IP. """ try: method_call.call_api(self, method="gslb.service_ip.delete", format="json", name=self.name) return 0 except AxAPIError, e: return e.code
def delete(self): """ method: slb.virtual_server.delete Delete the virtual server. """ try: method_call.call_api(self, method="slb.virtual_server.delete", format="json", name=self.name) return 0 except AxAPIError, e: return e.code
def update(self): """ method: gslb.dns_proxy.update Update the GSLB DNS proxy. """ try: method_call.call_api(self, method="gslb.dns_proxy.update", format="json", post_data=self.getRequestPostDataJson()) return 0 except AxAPIError, e: return e.code
def delete(self): """ method: gslb.dns_proxy.delete Delete the GSLB DNS proxy. """ try: method_call.call_api(self, method="gslb.dns_proxy.delete", format="json", name=self.name) return 0 except AxAPIError, e: return e.code
def addIpv4Address(self, addr, mask): """ method: network.ve.ipv4.add Add the IPv4 address, addr/mask for given interface. """ try: method_call.call_api(self, method="network.ve.ipv4.add", format="url", port_num=self.port_num, ipv4_addr=addr, ipv4_mask=mask) return 0 except AxAPIError, e: return e.code
def addIpv6Address(self, v6_addr, v6_addr_prefix_len): """ method: network.interface.ipv6.add Add the IPv6 address, v6_addr/v6_addr_prefix_len for given interface. """ try: method_call.call_api(self, method="network.ve.ipv6.add", format="url", port_num=self.port_num, ipv6_addr=v6_addr, ipv6_prefix_len=v6_addr_prefix_len) return 0 except AxAPIError, e: return e.code
def update(self): """ method: system.ntp.update Update the NTP entry. """ try: alist = list() alist.append(self.getObjectDict()) ntp = SystemNtp(ntp_list=alist) method_call.call_api(self, method="system.ntp.update", format="url", post_data=ntp.getRequestPostDataXml()) return 0 except AxAPIError, e: return e.code
def _load_methods(): """ Loads the list of all methods """ global __methods__ r = call_api(method = "flickr.reflection.getMethods") __methods__ = r["methods"]["method"]
def _load_methods(): """ Loads the list of all methods """ global __methods__ r = call_api(method="flickr.reflection.getMethods") __methods__ = r["methods"]["method"]
def static_call(*args, **kwargs): token, kwargs = _get_token(None, **kwargs) method_args, format_result = method(*args, **kwargs) method_args["auth_handler"] = token r = method_call.call_api(method=flickr_method, **method_args) try: return format_result(r, token) except TypeError: return format_result(r)
def delete(self): """ method: slb.server.delete Delete the real server. """ try: if len(self.name) > 0: method_call.call_api(self, method="slb.server.delete", format="json", name=self.name) else: method_call.call_api(self, method="slb.server.delete", format="json", host=self.host) return 0 except AxAPIError, e: return e.code
def static_call(*args,**kwargs): token,kwargs = _get_token(None,**kwargs) method_args,format_result = method(*args,**kwargs) method_args["auth_handler"] = token r = method_call.call_api(method = flickr_method,**method_args) try : return format_result(r,token) except TypeError : return format_result(r)
def call(self, *args, **kwargs): token, kwargs = _get_token(self, **kwargs) method_args, format_result = method(self, *args, **kwargs) method_args[call.__self_name__] = self.id if token: method_args["auth_handler"] = token r = method_call.call_api(method=flickr_method, **method_args) try: return format_result(r, token) except TypeError: return format_result(r)
def call(self,*args,**kwargs): token,kwargs = _get_token(self,**kwargs) method_args,format_result = method(self,*args,**kwargs) method_args[call.__self_name__] = self.id if token : method_args["auth_handler"] = token r = method_call.call_api(method = flickr_method,**method_args) try : return format_result(r,token) except TypeError : return format_result(r)
def load_methods(): """ Loads the list of all methods """ try: r = yield call_api(method="flickr.reflection.getMethods") except Exception as e: raise e raise Return(r["methods"]["method"])
def load_methods(): """ Loads the list of all methods """ try: r = yield call_api(method="flickr.reflection.getMethods") except Exception as e: raise e raise Return(r["methods"]["method"])
def read(): """ method : gslb.global.get Returns GSLB global settings. """ try: r = method_call.call_api(GslbGlobalSettings(), method="gslb.global.get", format="json") return GslbGlobalSettings(**r) except AxAPIError: return None
def searchByName(name): """ method: gslb.service_ip.search Search the GSLB service-ip by given name. """ try: r = method_call.call_api(GslbServiceIP(), method="gslb.service_ip.search", name=name, format="json") return GslbServiceIP(**r[GslbServiceIP.__obj_name__]) except AxAPIError: return None
def get(port_num): """ method: network.interface.get Get the interface configuration by given port number. """ try: r = method_call.call_api(Interface(), method="network.interface.get", port_num=port_num, format="url") return Interface(**r[Interface.__obj_name__]) except AxAPIError: return None
def searchByName(name): """ method: gslb.policy.search Search the GSLB policy by given name. """ try: r = method_call.call_api(GslbPolicy(), method="gslb.policy.search", name=name, format="json") return GslbPolicy(**r[GslbPolicy.__obj_name__]) except AxAPIError: return None
def searchByName(name): """ method: slb.virtual_server.search Search the virtual server by given name. """ try: r = method_call.call_api(VirtualServer(), method="slb.virtual_server.search", name=name, format="url") return VirtualServer(**r[VirtualServer.__obj_name__]) except AxAPIError: return None
def searchByName(name): try: r = method_call.call_api(RealServerStats(), method="slb.server.fetchAllStatistics", name=name, format="json") if len(r[RealServerStats.__obj_name__]) > 0: return RealServerStats(**r[RealServerStats.__obj_name__][0]) else: return None except AxAPIError: return None
def searchByHost(host): """ method: slb.server.search Search the real server by given host IP or host name. """ try: r = method_call.call_api(self, method="slb.server.search", host=host, format="json") return RealServer(**r[RealServer.__obj_name__]) except AxAPIError: return None
def searchByName(name): """ method: slb.server.search Search the real server by given name. """ try: r = method_call.call_api(RealServer(), method="slb.server.search", name=name, format="json") return RealServer(**r[RealServer.__obj_name__]) except AxAPIError: return None
def searchByName(name): """ method: slb.service_group.search Search the service group by given name. """ try: r = method_call.call_api(ServiceGroup(), method="slb.service_group.search", name=name, format="json") return ServiceGroup(**r[ServiceGroup.__obj_name__]) except AxAPIError: return None
def methods_info(): methods = {} for m in load_methods(): info = call_api(method="flickr.reflection.getMethodInfo", method_name=m) info.pop("stat") method = info.pop("method") method["requiredperms"] = __perms__[method["requiredperms"]] method["needslogin"] = bool(method.pop("needslogin")) method["needssigning"] = bool(method.pop("needssigning")) info.update(method) info["arguments"] = info["arguments"]["argument"] info["errors"] = info["errors"]["error"] methods[m] = info return methods
def load_methods(): """ Loads the list of all methods """ r = call_api(method="flickr.reflection.getMethods") return r["methods"]["method"]
def __call__(self, **kwargs): return call_api(auth_handler = auth.AUTH_HANDLER,raw = True,method = self.name,**kwargs)