tmp/src/things/things.py
def createPhysicalInterface(self, name, description=None):
        """
        Create a physical interface.
        Parameters:
          - name (string)
          - description (string, optional)
        Returns: physical interface id, response.
        Throws APIException on failure.
        """
        req = ApiClient.allPhysicalInterfacesUrl % (self.host, "/draft")
        body = {"name" : name}
        if description:
            body["description"] = description
        resp = requests.post(req, auth=self.credentials, headers={"Content-Type":"application/json"},
                            data=json.dumps(body),  verify=self.verify)
        if resp.status_code == 201:
            self.logger.debug("physical interface created")
        else:
            raise ibmiotf.APIException(resp.status_code, "HTTP error creating physical interface", resp)
        return resp.json()["id"], resp.json()
def createPhysicalInterface(self, name, description=None):
        """
        Create a physical interface.
        Parameters:
          - name (string)
          - description (string, optional)
        Returns: physical interface id, response.
        Throws APIException on failure.
        """
        req = ApiClient.allPhysicalInterfacesUrl % (self.host, "/draft")
        body = {"name" : name}
        if description:
            body["description"] = description
        resp = requests.post(req, auth=self.credentials, headers={"Content-Type":"application/json"},
                            data=json.dumps(body),  verify=self.verify)
        if resp.status_code == 201:
            self.logger.debug("physical interface created")
        else:
            raise ibmiotf.APIException(resp.status_code, "HTTP error creating physical interface", resp)
        return resp.json()["id"], resp.json()
Create a physical interface.
        Parameters:
          - name (string)
          - description (string, optional)
        Returns: physical interface id, response.
        Throws APIException on failure.