mixcoatl/resource.py
def from_file(cls, filename):
        """ Load a DCM endpoint definition from a json file and return and Endpoint object.

        :param str filename: the full path to a json file containing and endpoint definition
        :returns: the endpoint loaded from the file
        :rtype: Endpoint

        An example json file containing the containing the endpoint definition:

            .. code-block:: json
            
                {
                  "nickname":"saas",
                  "url":"https://dcm.enstratius.com/api/enstratus/2015-05-25",
                  "api_version":"2015-05-25",
                  "access_key":"abcdefg",
                  "secret_key":"gfedcba",
                  "ssl_verify": true
                }
        """

        endpoint_json = open(filename).read()
        e = json.loads(endpoint_json)

        return Endpoint(url=e['url'],
                        basepath=e['basepath'] if 'basepath' in e else None,
                        api_version=e['api_version'],
                        secret_key=str(e['secret_key']),
                        access_key=str(e['access_key']),
                        ssl_verify=e['ssl_verify'] if 'ssl_verify' in e else None,
                        nickname=e['nickname'] if 'nickname' in e else None)
 Load a DCM endpoint definition from a json file and return and Endpoint object.

        :param str filename: the full path to a json file containing and endpoint definition
        :returns: the endpoint loaded from the file
        :rtype: Endpoint

        An example json file containing the containing the endpoint definition:

            .. code-block:: json
            
                {
                  "nickname":"saas",
                  "url":"https://dcm.enstratius.com/api/enstratus/2015-05-25",
                  "api_version":"2015-05-25",
                  "access_key":"abcdefg",
                  "secret_key":"gfedcba",
                  "ssl_verify": true
                }
        
Load a DCM endpoint definition from a json file and return and Endpoint object.
Load a DCM endpoint definition from a json file and return and Endpoint object .
def from_file(cls, filename):
        endpoint_json = open(filename).read()
        e = json.loads(endpoint_json)
        return Endpoint(url=e['url'],
                        basepath=e['basepath'] if 'basepath' in e else None,
                        api_version=e['api_version'],
                        secret_key=str(e['secret_key']),
                        access_key=str(e['access_key']),
                        ssl_verify=e['ssl_verify'] if 'ssl_verify' in e else None,
                        nickname=e['nickname'] if 'nickname' in e else None)
def from_file ( cls , filename ) : endpoint_json = open ( filename ) . read ( ) e = json . loads ( endpoint_json ) return Endpoint ( url = e [ 'url' ] , basepath = e [ 'basepath' ] if 'basepath' in e else None , api_version = e [ 'api_version' ] , secret_key = str ( e [ 'secret_key' ] ) , access_key = str ( e [ 'access_key' ] ) , ssl_verify = e [ 'ssl_verify' ] if 'ssl_verify' in e else None , nickname = e [ 'nickname' ] if 'nickname' in e else None )
Load a DCM endpoint definition from a json file and return and Endpoint object.
Load a DCM endpoint definition from a json file and return and Endpoint object .
""" Load a DCM endpoint definition from a json file and return and Endpoint object.

        :param str filename: the full path to a json file containing and endpoint definition
        :returns: the endpoint loaded from the file
        :rtype: Endpoint

        An example json file containing the containing the endpoint definition:

            .. code-block:: json
            
                {
                  "nickname":"saas",
                  "url":"https://dcm.enstratius.com/api/enstratus/2015-05-25",
                  "api_version":"2015-05-25",
                  "access_key":"abcdefg",
                  "secret_key":"gfedcba",
                  "ssl_verify": true
                }
        """
the endpoint loaded from the file
the endpoint loaded from the file
Endpoint
An example json file containing the containing the endpoint definition:

    .. code-block:: json
    
        {
          "nickname":"saas",
          "url":"https://dcm.enstratius.com/api/enstratus/2015-05-25",
          "api_version":"2015-05-25",
          "access_key":"abcdefg",
          "secret_key":"gfedcba",
          "ssl_verify": true
        }
cls
filename
the full path to a json file containing and endpoint definition
the full path to a json file containing and endpoint definition