• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.is_valid_int_param函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中networkapiclient.utils.is_valid_int_param函数的典型用法代码示例。如果您正苦于以下问题:Python is_valid_int_param函数的具体用法?Python is_valid_int_param怎么用?Python is_valid_int_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_valid_int_param函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: inserir

    def inserir(self, id_user, id_group):
        """Create a relationship between User and Group.

        :param id_user: Identifier of the User. Integer value and greater than zero.
        :param id_group: Identifier of the Group. Integer value and greater than zero.

        :return: Dictionary with the following structure:

        ::
            {'user_group': {'id': < id_user_group >}}

        :raise InvalidParameterError: The identifier of User or Group is null and invalid.
        :raise GrupoUsuarioNaoExisteError: UserGroup not registered.
        :raise UsuarioNaoExisteError: User not registered.
        :raise UsuarioGrupoError: User already registered in the group.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """
        if not is_valid_int_param(id_user):
            raise InvalidParameterError(
                u'The identifier of User is invalid or was not informed.')

        if not is_valid_int_param(id_group):
            raise InvalidParameterError(
                u'The identifier of Group is invalid or was not informed.')

        url = 'usergroup/user/' + \
            str(id_user) + '/ugroup/' + str(id_group) + '/associate/'

        code, xml = self.submit(None, 'PUT', url)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:30,代码来源:UsuarioGrupo.py


示例2: remover

    def remover(self, id_tipo_acesso, id_equipamento):
        """Removes relationship between equipment and access type.

        :param id_equipamento: Equipment identifier.
        :param id_tipo_acesso: Access type identifier.

        :return: None

        :raise EquipamentoNaoExisteError: Equipment doesn't exist.
        :raise EquipamentoAcessoNaoExisteError: Relationship between equipment and access type doesn't exist.
        :raise InvalidParameterError: Equipment and/or access type id is/are invalid.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_tipo_acesso):
            raise InvalidParameterError(u'Access type id is invalid.')

        if not is_valid_int_param(id_equipamento):
            raise InvalidParameterError(u'Equipment id is invalid.')

        url = 'equipamentoacesso/' + \
            str(id_equipamento) + '/' + str(id_tipo_acesso) + '/'

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:27,代码来源:EquipamentoAcesso.py


示例3: disassociate

    def disassociate(self, id_option_vip, id_environment_vip):
        """Remove a relationship of OptionVip with EnvironmentVip.

        :param id_option_vip: Identifier of the Option VIP. Integer value and greater than zero.
        :param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.

        :return: Nothing

        :raise InvalidParameterError: Option VIP/Environment VIP identifier is null and/or invalid.
        :raise OptionVipNotFoundError: Option VIP not registered.
        :raise EnvironmentVipNotFoundError: Environment VIP not registered.
        :raise OptionVipError: Option vip is not associated with the environment vip
        :raise UserNotAuthorizedError: User does not have authorization to make this association.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_option_vip):
            raise InvalidParameterError(u"The identifier of Option VIP is invalid or was not informed.")

        if not is_valid_int_param(id_environment_vip):
            raise InvalidParameterError(u"The identifier of Environment VIP is invalid or was not informed.")

        url = "optionvip/" + str(id_option_vip) + "/environmentvip/" + str(id_environment_vip) + "/"

        code, xml = self.submit(None, "DELETE", url)

        return self.response(code, xml)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:28,代码来源:OptionVIP.py


示例4: remover

    def remover(self, id_equipment, id_script):
        """Remove Related Equipment with Script from by the identifier.

        :param id_equipment: Identifier of the Equipment. Integer value and greater than zero.
        :param id_script: Identifier of the Script. Integer value and greater than zero.

        :return: None

        :raise InvalidParameterError: The identifier of Equipment or Script is null and invalid.
        :raise RoteiroNaoExisteError: Script not registered.
        :raise EquipamentoNaoExisteError: Equipment not registered.
        :raise EquipamentoRoteiroNaoExisteError: Equipment is not associated with the script.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response
        """
        if not is_valid_int_param(id_equipment):
            raise InvalidParameterError(
                u'The identifier of Equipment is invalid or was not informed.')

        if not is_valid_int_param(id_script):
            raise InvalidParameterError(
                u'The identifier of Script is invalid or was not informed.')

        url = 'equipmentscript/' + \
            str(id_equipment) + '/' + str(id_script) + '/'

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:29,代码来源:EquipamentoRoteiro.py


示例5: associate

    def associate(self, id_option_vip, id_environment_vip):
        """Create a relationship of OptionVip with EnvironmentVip.

        :param id_option_vip: Identifier of the Option VIP. Integer value and greater than zero.
        :param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.

        :return: Following dictionary

        ::

            {'opcoesvip_ambiente_xref': {'id': < id_opcoesvip_ambiente_xref >} }

        :raise InvalidParameterError: Option VIP/Environment VIP identifier is null and/or invalid.
        :raise OptionVipNotFoundError: Option VIP not registered.
        :raise EnvironmentVipNotFoundError: Environment VIP not registered.
        :raise OptionVipError: Option vip is already associated with the environment vip.
        :raise UserNotAuthorizedError: User does not have authorization to make this association.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_option_vip):
            raise InvalidParameterError(
                u'The identifier of Option VIP is invalid or was not informed.')

        if not is_valid_int_param(id_environment_vip):
            raise InvalidParameterError(
                u'The identifier of Environment VIP is invalid or was not informed.')

        url = 'optionvip/' + \
            str(id_option_vip) + '/environmentvip/' + str(id_environment_vip) + '/'

        code, xml = self.submit(None, 'PUT', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:35,代码来源:OptionVIP.py


示例6: remove

    def remove(self, id_equipamento, id_egrupo):
        """Remove a associacao de um grupo de equipamento com um equipamento a partir do seu identificador.

        :param id_egrupo: Identificador do grupo de equipamento.
        :param id_equipamento: Identificador do equipamento.

        :return: None

        :raise EquipamentoNaoExisteError: Equipamento não cadastrado.
        :raise GrupoEquipamentoNaoExisteError: Grupo de equipamento não cadastrado.
        :raise InvalidParameterError: O identificador do grupo é nulo ou inválido.
        :raise DataBaseError: Falha na networkapi ao acessar o banco de dados.
        :raise XMLError: Falha na networkapi ao gerar o XML de resposta.
        """

        if not is_valid_int_param(id_egrupo):
            raise InvalidParameterError(
                u'O identificador do grupo de equipamento é inválido ou não foi informado.')

        if not is_valid_int_param(id_equipamento):
            raise InvalidParameterError(
                u'O identificador do equipamento é inválido ou não foi informado.')

        url = 'egrupo/equipamento/' + \
            str(id_equipamento) + '/egrupo/' + str(id_egrupo) + '/'

        code, xml = self.submit(None, 'GET', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:29,代码来源:GrupoEquipamento.py


示例7: dissociate

    def dissociate(self, id_filter, id_eq_type):
        """Removes relationship between Filter and TipoEquipamento.

        :param id_filter: Identifier of Filter. Integer value and greater than zero.
        :param id_eq_type: Identifier of TipoEquipamento. Integer value, greater than zero.

        :return: None

        :raise FilterNotFoundError: Filter not registered.
        :raise TipoEquipamentoNotFoundError: TipoEquipamento not registered.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_filter):
            raise InvalidParameterError(
                u'The identifier of Filter is invalid or was not informed.')

        if not is_valid_int_param(id_eq_type):
            raise InvalidParameterError(
                u'The identifier of TipoEquipamento is invalid or was not informed.')

        url = 'filter/' + \
            str(id_filter) + '/dissociate/' + str(id_eq_type) + '/'

        code, xml = self.submit(None, 'PUT', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:28,代码来源:Filter.py


示例8: associate

    def associate(self, et_id, id_filter):
        """Create a relationship between Filter and TipoEquipamento.

        :param et_id: Identifier of TipoEquipamento. Integer value and greater than zero.
        :param id_filter: Identifier of Filter. Integer value and greater than zero.

        :return: Following dictionary:

        ::

            {'equiptype_filter_xref': {'id': < id_equiptype_filter_xref >} }

        :raise InvalidParameterError: TipoEquipamento/Filter identifier is null and/or invalid.
        :raise TipoEquipamentoNaoExisteError: TipoEquipamento not registered.
        :raise FilterNotFoundError: Filter not registered.
        :raise FilterEqTypeAssociationError: TipoEquipamento and Filter already associated.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(et_id):
            raise InvalidParameterError(
                u'The identifier of TipoEquipamento is invalid or was not informed.')

        if not is_valid_int_param(id_filter):
            raise InvalidParameterError(
                u'The identifier of Filter is invalid or was not informed.')

        url = 'filter/' + str(id_filter) + '/equiptype/' + str(et_id) + '/'

        code, xml = self.submit(None, 'PUT', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:33,代码来源:Filter.py


示例9: remover

    def remover(self, id_user, id_group):
        """Removes relationship between User and Group.

        :param id_user: Identifier of the User. Integer value and greater than zero.
        :param id_group: Identifier of the Group. Integer value and greater than zero.

        :return: None

        :raise UsuarioGrupoNaoExisteError: Association between user and group not registered.
        :raise GrupoUsuarioNaoExisteError: UserGroup not registered.
        :raise UsuarioNaoExisteError: User not registered.
        :raise UsuarioGrupoError: User already registered in the group.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """
        if not is_valid_int_param(id_user):
            raise InvalidParameterError(
                u'The identifier of User is invalid or was not informed.')

        if not is_valid_int_param(id_group):
            raise InvalidParameterError(
                u'The identifier of Group is invalid or was not informed.')

        url = 'usergroup/user/' + \
            str(id_user) + '/ugroup/' + str(id_group) + '/dissociate/'

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:29,代码来源:UsuarioGrupo.py


示例10: associar_ip

    def associar_ip(self, id_equipamento, id_ip):
        """Associa um IP a um equipamento.

        :param id_equipamento: Identificador do equipamento.
        :param id_ip: Identificador do IP.

        :return: Dicionário com a seguinte estrutura:
            {'ip_equipamento': {'id': < id_ip_do_equipamento >}}

        :raise EquipamentoNaoExisteError: Equipamento não cadastrado.
        :raise IpNaoExisteError: IP não cadastrado.
        :raise IpError: IP já está associado ao equipamento.
        :raise InvalidParameterError: O identificador do equipamento e/ou do IP são nulos ou inválidos.
        :raise DataBaseError: Falha na networkapi ao acessar o banco de dados.
        :raise XMLError: Falha na networkapi ao gerar o XML de resposta.
        """

        if not is_valid_int_param(id_equipamento):
            raise InvalidParameterError(
                u'O identificador do equipamento é inválido ou não foi informado.')

        if not is_valid_int_param(id_ip):
            raise InvalidParameterError(
                u'O identificador do ip é inválido ou não foi informado.')

        url = 'ip/' + str(id_ip) + '/equipamento/' + str(id_equipamento) + '/'

        code, xml = self.submit(None, 'PUT', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:30,代码来源:Equipamento.py


示例11: remover

    def remover(self, id_equipment, id_environment):
        """Remove Related Equipment with Environment from by the identifier.

        :param id_equipment: Identifier of the Equipment. Integer value and greater than zero.
        :param id_environment: Identifier of the Environment. Integer value and greater than zero.

        :return: None

        :raise InvalidParameterError:  The identifier of Environment, Equipament is null and invalid.
        :raise EquipamentoNotFoundError: Equipment not registered.
        :raise EquipamentoAmbienteNaoExisteError: Environment not registered.
        :raise VipIpError: IP-related equipment is being used for a request VIP.
        :raise XMLError: Networkapi failed to generate the XML response.
        :raise DataBaseError: Networkapi failed to access the database.
        """

        if not is_valid_int_param(id_equipment):
            raise InvalidParameterError(u"The identifier of Equipment is invalid or was not informed.")

        if not is_valid_int_param(id_environment):
            raise InvalidParameterError(u"The identifier of Environment is invalid or was not informed.")

        url = "equipment/" + str(id_equipment) + "/environment/" + str(id_environment) + "/"

        code, xml = self.submit(None, "DELETE", url)

        return self.response(code, xml)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:27,代码来源:EquipamentoAmbiente.py


示例12: associate_ipv6

    def associate_ipv6(self, id_equip, id_ipv6):
        """Associates an IPv6 to a equipament.

        :param id_equip: Identifier of the equipment. Integer value and greater than zero.
        :param id_ipv6: Identifier of the ip. Integer value and greater than zero.

        :return: Dictionary with the following structure:
            {'ip_equipamento': {'id': < id_ip_do_equipamento >}}

        :raise EquipamentoNaoExisteError: Equipment is not registered.
        :raise IpNaoExisteError: IP not registered.
        :raise IpError: IP is already associated with the equipment.
        :raise InvalidParameterError:  Identifier of the equipment and/or IP is null or invalid.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_equip):
            raise InvalidParameterError(
                u'The identifier of equipment is invalid or was not informed.')

        if not is_valid_int_param(id_ipv6):
            raise InvalidParameterError(
                u'The identifier of ip is invalid or was not informed.')

        url = 'ipv6/' + str(id_ipv6) + '/equipment/' + str(id_equip) + '/'

        code, xml = self.submit(None, 'PUT', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:30,代码来源:Equipamento.py


示例13: disassociate_environment_option_pool

    def disassociate_environment_option_pool(self, environment_option_id):
        """Remove a relationship of optionpool with Environment.

        :param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
        :param id_environment: Identifier of the Environment Pool. Integer value and greater than zero.

        :return: { 'id': < environment_option_id> }

        :raise InvalidParameterError: Option Pool/Environment Pool identifier is null and/or invalid.
        :raise optionpoolNotFoundError: Option Pool not registered.
        :raise EnvironmentVipNotFoundError: Environment VIP not registered.
        :raise optionpoolError: Option pool is not associated with the environment pool
        :raise UserNotAuthorizedError: User does not have authorization to make this association.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(environment_option_id):
            raise InvalidParameterError(
                u'The identifier of Option Pool is invalid or was not informed.')

        if not is_valid_int_param(environment_option_id):
            raise InvalidParameterError(
                u'The identifier of Environment Pool is invalid or was not informed.')

        url = 'api/pools/environment_options/' + str(environment_option_id) +  '/'

        return self.delete(url)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:28,代码来源:OptionPool.py


示例14: remove_ipv6

    def remove_ipv6(self, id_equip, id_ipv6):
        """Remove an IPv6 to a equipament.

        :param id_equip: Identifier of the equipment. Integer value and greater than zero.
        :param id_ipv6: Identifier of the ip. Integer value and greater than zero.

        :return: None

        :raise EquipamentoNaoExisteError: Equipment is not registered.
        :raise IpNaoExisteError: IP not registered.
        :raise IpError: Dont  IP is already associated with the equipment.
        :raise InvalidParameterError:  Identifier of the equipment and/or IP is null or invalid.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_equip):
            raise InvalidParameterError(
                u'The identifier of equipment is invalid or was not informed.')

        if not is_valid_int_param(id_ipv6):
            raise InvalidParameterError(
                u'The identifier of ip is invalid or was not informed.')

        url = 'ipv6/' + str(id_ipv6) + '/equipment/' + \
            str(id_equip) + '/remove/'

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:30,代码来源:Equipamento.py


示例15: update

    def update(self, id_equipment, id_environment, is_router):
        """Remove Related Equipment with Environment from by the identifier.

        :param id_equipment: Identifier of the Equipment. Integer value and greater than zero.
        :param id_environment: Identifier of the Environment. Integer value and greater than zero.
        :param is_router: Identifier of the Environment. Boolean value.

        :return: None

        :raise InvalidParameterError:  The identifier of Environment, Equipament is null and invalid.
        :raise EquipamentoNotFoundError: Equipment not registered.
        :raise EquipamentoAmbienteNaoExisteError: Environment not registered.
        :raise VipIpError: IP-related equipment is being used for a request VIP.
        :raise XMLError: Networkapi failed to generate the XML response.
        :raise DataBaseError: Networkapi failed to access the database.
        """

        if not is_valid_int_param(id_equipment):
            raise InvalidParameterError(u"The identifier of Equipment is invalid or was not informed.")

        if not is_valid_int_param(id_environment):
            raise InvalidParameterError(u"The identifier of Environment is invalid or was not informed.")

        equipment_environment_map = dict()
        equipment_environment_map["id_equipamento"] = id_equipment
        equipment_environment_map["id_ambiente"] = id_environment
        equipment_environment_map["is_router"] = is_router

        code, xml = self.submit(
            {"equipamento_ambiente": equipment_environment_map}, "PUT", "equipamentoambiente/update/"
        )

        return self.response(code, xml)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:33,代码来源:EquipamentoAmbiente.py


示例16: remover_ip

    def remover_ip(self, id_equipamento, id_ip):
        """Removes association of IP and Equipment.
        If IP has no other association with equipments, IP is also removed.

        :param id_equipamento: Equipment identifier
        :param id_ip: IP identifier.

        :return: None

        :raise VipIpError: Ip can't be removed because there is a created Vip Request.
        :raise IpEquipCantDissociateFromVip: Equipment is the last balancer for created Vip Request.
        :raise IpError: IP not associated with equipment.
        :raise InvalidParameterError: Equipment or IP identifier is none or invalid.
        :raise EquipamentoNaoExisteError: Equipment doesn't exist.
        :raise DataBaseError: Networkapi failed to access database.
        :raise XMLError: Networkapi failed to build response XML.
        """

        if not is_valid_int_param(id_equipamento):
            raise InvalidParameterError(
                u'O identificador do equipamento é inválido ou não foi informado.')

        if not is_valid_int_param(id_ip):
            raise InvalidParameterError(
                u'O identificador do ip é inválido ou não foi informado.')

        url = 'ip/' + str(id_ip) + '/equipamento/' + str(id_equipamento) + '/'

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:31,代码来源:Equipamento.py


示例17: disassociate

    def disassociate(self, environment_id, environment_vip_id):
        """Remove a relationship of Environment with EnvironmentVip.

        :param environment_id: Identifier of the Environment. Integer value and greater than zero.
        :param environment_vip_id: Identifier of the Environment VIP. Integer value and greater than zero.

        :return: Nothing

        :raise InvalidParameterError: Environment/Environment VIP identifier is null and/or invalid.
        :raise EnvironmentNotFoundError: Environment not registered.
        :raise EnvironmentVipNotFoundError: Environment VIP not registered.
        :raise EnvironmentError: Option vip is not associated with the environment vip
        :raise UserNotAuthorizedError: User does not have authorization to make this association.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(environment_id):
            raise InvalidParameterError(
                u'The identifier of Environment VIP is invalid or was not informed.')

        if not is_valid_int_param(environment_vip_id):
            raise InvalidParameterError(
                u'The identifier of Environment is invalid or was not informed.')

        environment_environment_vip_map = dict()
        environment_environment_vip_map['environment_id'] = environment_id
        environment_environment_vip_map['environment_vip_id'] = environment_vip_id

        url = 'environment/{}/environmentvip/{}/'.format(environment_id, environment_vip_id)

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:34,代码来源:Ambiente.py


示例18: associate

    def associate(self, environment_id, environment_vip_id):

        """Associate a news Environment on Environment VIP and returns its identifier.

        :param environment_id: Identifier of the Environment. Integer value and greater than zero.
        :param environment_vip_id: Identifier of the Environment VIP. Integer value and greater than zero.

        :return: Following dictionary:

        ::

            {'environment_environment_vip': {'id': < id >}}

        :raise InvalidParameterError: The value of environment_id or environment_vip_id is invalid.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """
        if not is_valid_int_param(environment_id):
            raise InvalidParameterError(
                u'The identifier of Environment VIP is invalid or was not informed.')

        if not is_valid_int_param(environment_vip_id):
            raise InvalidParameterError(
                u'The identifier of Environment is invalid or was not informed.')

        environment_environment_vip_map = dict()
        environment_environment_vip_map['environment_id'] = environment_id
        environment_environment_vip_map['environment_vip_id'] = environment_vip_id

        url = 'environment/{}/environmentvip/{}/'.format(environment_id, environment_vip_id)

        code, xml = self.submit(None, 'PUT', url)

        return self.response(code, xml)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:34,代码来源:Ambiente.py


示例19: remover_grupo

    def remover_grupo(self, id_equipamento, id_grupo):
        """Remove a associação de um equipamento com um grupo de equipamento.

        :param id_equipamento: Identificador do equipamento.
        :param id_grupo: Identificador do grupo de equipamento.

        :return: None

        :raise EquipamentoGrupoNaoExisteError: Associação entre grupo e equipamento não cadastrada.
        :raise EquipamentoNaoExisteError: Equipamento não cadastrado.
        :raise EquipmentDontRemoveError: Failure to remove an association between an equipment and a group because the group is related only to a group.
        :raise InvalidParameterError: O identificador do equipamento e/ou do grupo são nulos ou inválidos.
        :raise DataBaseError: Falha na networkapi ao acessar o banco de dados.
        :raise XMLError: Falha na networkapi ao gerar o XML de resposta.
        """

        if not is_valid_int_param(id_equipamento):
            raise InvalidParameterError(
                u'O identificador do equipamento é inválido ou não foi informado.')

        if not is_valid_int_param(id_grupo):
            raise InvalidParameterError(
                u'O identificador do grupo é inválido ou não foi informado.')

        url = 'equipamentogrupo/equipamento/' + \
            str(id_equipamento) + '/egrupo/' + str(id_grupo) + '/'

        code, xml = self.submit(None, 'DELETE', url)

        return self.response(code, xml)
开发者ID:Milstein,项目名称:GloboNetworkAPI-client-python,代码行数:30,代码来源:Equipamento.py


示例20: edit_vlan

    def edit_vlan(
            self,
            environment_id,
            name,
            number,
            description,
            acl_file,
            acl_file_v6,
            id_vlan):
        """Edit a VLAN

        :param id_vlan: ID for Vlan
        :param environment_id: ID for Environment.
        :param name: The name of VLAN.
        :param description: Some description to VLAN.
        :param number: Number of Vlan
        :param acl_file: Acl IPv4 File name to VLAN.
        :param acl_file_v6: Acl IPv6 File name to VLAN.

        :return: None

        :raise VlanError: VLAN name already exists, DC division of the environment invalid or there is no VLAN number available.
        :raise VlanNaoExisteError: VLAN not found.
        :raise AmbienteNaoExisteError: Environment not registered.
        :raise InvalidParameterError: Name of Vlan and/or the identifier of the Environment is null or invalid.
        :raise DataBaseError: Networkapi failed to access the database.
        :raise XMLError: Networkapi failed to generate the XML response.
        """

        if not is_valid_int_param(id_vlan):
            raise InvalidParameterError(
                u'Vlan id is invalid or was not informed.')

        if not is_valid_int_param(environment_id):
            raise InvalidParameterError(u'Environment id is none or invalid.')

        if not is_valid_int_param(number):
            raise InvalidParameterError(u'Vlan number is none or invalid')

        vlan_map = dict()
        vlan_map['vlan_id'] = id_vlan
        vlan_map['environment_id'] = environment_id
        vlan_map['name'] = name
        vlan_map['description'] = description
        vlan_map['acl_file'] = acl_file
        vlan_map['acl_file_v6'] = acl_file_v6
        vlan_map['number'] = number

        code, xml = self.submit({'vlan': vlan_map}, 'POST', 'vlan/edit/')

        return self.response(code, xml)
开发者ID:dknigh00,项目名称:GloboNetworkAPI-client-python,代码行数:51,代码来源:Vlan.py



注:本文中的networkapiclient.utils.is_valid_int_param函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python _i18n._LE函数代码示例发布时间:2022-05-27
下一篇:
Python utils.get_list_map函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap