Ejemplo n.º 1
0
 def create_on_device(self):
     url = 'https://{0}:{1}/mgmt/cm/autodeploy/software-image-uploads'.format(
         self.client.provider['server'],
         self.client.provider['server_port'])
     try:
         upload_file(self.client, url, self.want.image)
     except F5ModuleError:
         raise F5ModuleError("Failed to upload the file.")
Ejemplo n.º 2
0
 def upload_file_to_device(self, content, name):
     url = 'https://{0}:{1}/mgmt/shared/file-transfer/uploads'.format(
         self.client.provider['server'],
         self.client.provider['server_port'])
     try:
         upload_file(self.client, url, content, name)
     except F5ModuleError:
         raise F5ModuleError("Failed to upload the file.")
Ejemplo n.º 3
0
 def upload_to_device(self, temp_name):
     template = StringIO(self.want.merge_content)
     url = 'https://{0}:{1}/mgmt/shared/file-transfer/uploads'.format(
         self.client.provider['server'],
         self.client.provider['server_port'])
     try:
         upload_file(self.client, url, template, temp_name)
     except F5ModuleError:
         raise F5ModuleError("Failed to upload the file.")
    def upload_to_device(self, content, name):
        """Uploads a file-like object via the REST API to a given filename

        Args:
            content: The file-like object whose content to upload
            name: The remote name of the file to store the content in. The
                  final location of the file will be in /var/config/rest/downloads.

        Returns:
            void
        """
        url = 'https://{0}:{1}/mgmt/shared/file-transfer/uploads'.format(
            self.client.provider['server'],
            self.client.provider['server_port'])
        try:
            upload_file(self.client, url, content, name)
        except F5ModuleError:
            raise F5ModuleError("Failed to upload the file.")