# Path: tackerclient/common/exceptions.py
# class TackerException(Exception):
# class TackerClientException(TackerException):
# class BadRequest(TackerClientException):
# class Unauthorized(TackerClientException):
# class Forbidden(TackerClientException):
# class NotFound(TackerClientException):
# class Conflict(TackerClientException):
# class InternalServerError(TackerClientException):
# class ServiceUnavailable(TackerClientException):
# class NetworkNotFoundClient(NotFound):
# class PortNotFoundClient(NotFound):
# class StateInvalidClient(BadRequest):
# class NetworkInUseClient(Conflict):
# class PortInUseClient(Conflict):
# class IpAddressInUseClient(Conflict):
# class InvalidIpForNetworkClient(BadRequest):
# class OverQuotaClient(Conflict):
# class IpAddressGenerationFailureClient(Conflict):
# class MacAddressInUseClient(Conflict):
# class ExternalIpAddressExhaustedClient(BadRequest):
# class NoAuthURLProvided(Unauthorized):
# class EndpointNotFound(TackerClientException):
# class EndpointTypeNotFound(TackerClientException):
# class AmbiguousEndpoints(TackerClientException):
# class RequestURITooLong(TackerClientException):
# class ConnectionFailed(TackerClientException):
# class SslCertificateValidationError(TackerClientException):
# class MalformedResponseBody(TackerClientException):
# class InvalidContentType(TackerClientException):
# class InvalidInput(TackerClientException):
# class UnsupportedCommandVersion(TackerClientException):
# class TackerCLIError(TackerException):
# class CommandError(TackerCLIError):
# class UnsupportedVersion(TackerCLIError):
# class TackerClientNoUniqueMatch(TackerCLIError):
#     def __init__(self, message=None, **kwargs):
#     def __str__(self):
#     def __init__(self, message=None, **kwargs):
#     def __init__(self, **kwargs):
# HTTP_EXCEPTION_MAP = {
#     400: BadRequest,
#     401: Unauthorized,
#     403: Forbidden,
#     404: NotFound,
#     409: Conflict,
#     500: InternalServerError,
#     503: ServiceUnavailable,
# }


from urllib import parse as urlparse
from tackerclient.common import exceptions
# All Rights Reserved.
#
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.




def args2body_vim(config_param, vim):
    """Create additional args to vim body

    :param vim: vim request object
    :return: vim body with args populated
    """
    vim_type = ['openstack', 'kubernetes']
    cert_verify_type = ['True', 'False']

    if 'type' in config_param:
        vim['type'] = config_param.pop('type', '')
        if not vim['type'] in vim_type:

# Path: tackerclient/common/exceptions.py
# class TackerException(Exception):
# class TackerClientException(TackerException):
# class BadRequest(TackerClientException):
# class Unauthorized(TackerClientException):
# class Forbidden(TackerClientException):
# class NotFound(TackerClientException):
# class Conflict(TackerClientException):
# class InternalServerError(TackerClientException):
# class ServiceUnavailable(TackerClientException):
# class NetworkNotFoundClient(NotFound):
# class PortNotFoundClient(NotFound):
# class StateInvalidClient(BadRequest):
# class NetworkInUseClient(Conflict):
# class PortInUseClient(Conflict):
# class IpAddressInUseClient(Conflict):
# class InvalidIpForNetworkClient(BadRequest):
# class OverQuotaClient(Conflict):
# class IpAddressGenerationFailureClient(Conflict):
# class MacAddressInUseClient(Conflict):
# class ExternalIpAddressExhaustedClient(BadRequest):
# class NoAuthURLProvided(Unauthorized):
# class EndpointNotFound(TackerClientException):
# class EndpointTypeNotFound(TackerClientException):
# class AmbiguousEndpoints(TackerClientException):
# class RequestURITooLong(TackerClientException):
# class ConnectionFailed(TackerClientException):
# class SslCertificateValidationError(TackerClientException):
# class MalformedResponseBody(TackerClientException):
# class InvalidContentType(TackerClientException):
# class InvalidInput(TackerClientException):
# class UnsupportedCommandVersion(TackerClientException):
# class TackerCLIError(TackerException):
# class CommandError(TackerCLIError):
# class UnsupportedVersion(TackerCLIError):
# class TackerClientNoUniqueMatch(TackerCLIError):
#     def __init__(self, message=None, **kwargs):
#     def __str__(self):
#     def __init__(self, message=None, **kwargs):
#     def __init__(self, **kwargs):
# HTTP_EXCEPTION_MAP = {
#     400: BadRequest,
#     401: Unauthorized,
#     403: Forbidden,
#     404: NotFound,
#     409: Conflict,
#     500: InternalServerError,
#     503: ServiceUnavailable,
# }


# Path: tackerclient/tacker/v1_0/nfvo/vim_utils.py
from urllib import parse as urlparse
from tackerclient.common import exceptions

# All Rights Reserved.
#
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.




def args2body_vim(config_param, vim):
    """Create additional args to vim body

    :param vim: vim request object
    :return: vim body with args populated
    """
    vim_type = ['openstack', 'kubernetes']
    cert_verify_type = ['True', 'False']

    if 'type' in config_param:
        vim['type'] = config_param.pop('type', '')
        if not vim['type'] in vim_type:

            raise exceptions.TackerClientException(