File Test RST

File is used for local file mangement. Please take note that actions such as rename, delete, and export use the Content-Type:application/json header as usual. However, the import action uses the Content-Type:multipart/form-data header. This is designed to upload resources of multiple types and execute the aXAPI call with one HTTP request.

  1. Only one JSON data section should be provided. It is the aXAPI call. Its name should be json.
  2. Other data sections will be treated as file data. And the filename should not be empty. JSON data will reference this filename. In the example below, you can see the JSON data file-handle attribute refers to the filename aflex-script.txt. Most object schemas under the file object use the same attribute of file-handle to do so. Otherwise, the backend will report errors.

An example of a POST method that would use the multipart header for importing and executing an aFleX text file follows:

POST /axapi/v3/file/aflex HTTP/1.1
Host: 10.10.10.21
Connection: keep-alive
Content-Length: 484
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36
Origin: http://10.10.10.21
Authorization: A10 f53e5c2e33b5f336018f072dd2b5c5
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryHf1lBo4wM6uXCQm3
Accept: */*
...

------WebKitFormBoundaryHf1lBo4wM6uXCQm3
Content-Disposition: form-data; name="json"; filename="blob"
Content-Type: application/json

{"aflex": {"file": "abc", "file-handle": "aflex-script.txt", "action":"import"}}

------WebKitFormBoundaryHf1lBo4wM6uXCQm3
Content-Disposition: form-data; name="file"; filename="aflex-script.txt"
Content-Type: text/plain

when HTTP_REQUEST {
  HTTP::redirect https://[HTTP::host][HTTP::uri]
}

------WebKitFormBoundaryHf1lBo4wM6uXCQm3--
^@HTTP/1.1 204 No Content
Date: Tue, 27 Oct 2015 09:00:09 GMT
Server: Apache
Content-Length: 68
Connection: close
Content-Type: application/json

{
  "response": {
        "status": "OK",
        "msg": "No content."
  }
}

In addition, the Content-Type for a successful GET request might not be application/json, which is up to the backend setting:

GET /axapi/v3/file/aflex/abc

HTTP/1.1 200 OK
Date: Tue, 27 Oct 2015 09:24:31 GMT
Server: Apache
Content-Length: 74
Connection: close
Content-Type: text/plain

when HTTP_REQUEST {
  HTTP::redirect https://[HTTP::host][HTTP::uri]
}

Fields

File.Aflex

Type: file.aflex

Short Description: aflex file information and management commands

Long Description:

GUI Description:

File.Aflex.file

Type: string

Short Description: aflex local file name

Long Description:

GUI Description:

File.Aflex.size

Type: int

Short Description: aflex file size in byte

Long Description:

GUI Description:

File.Aflex.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Aflex.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Aflex.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Xml_schema

Type: file.xml_schema

Short Description: XML-Schema file information and management commands

Long Description:

GUI Description:

File.Xml_schema.file

Type: string

Short Description: XML-Schema local file name

Long Description:

GUI Description:

File.Xml_schema.size

Type: int

Short Description: XML-Schema file size in byte

Long Description:

GUI Description:

File.Xml_schema.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Xml_schema.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Xml_schema.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Wsdl

Type: file.wsdl

Short Description: WSDL file information and management commands

Long Description:

GUI Description:

File.Wsdl.file

Type: string

Short Description: WSDL local file name

Long Description:

GUI Description:

File.Wsdl.size

Type: int

Short Description: WSDL file size in byte

Long Description:

GUI Description:

File.Wsdl.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Wsdl.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Wsdl.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Class_list

Type: file.class_list

Short Description: class list file information and management commands

Long Description:

GUI Description:

File.Class_list.file

Type: string

Short Description: class list local file name

Long Description:

GUI Description:

File.Class_list.size

Type: int

Short Description: class list file size in byte

Long Description:

GUI Description:

File.Class_list.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Class_list.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Class_list.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Bw_list

Type: file.bw_list

Short Description: black white list file information and management commands

Long Description:

GUI Description:

File.Bw_list.file

Type: string

Short Description: bw-list file name

Long Description:

GUI Description:

File.Bw_list.size

Type: int

Short Description: bw-list file size in byte

Long Description:

GUI Description:

File.Bw_list.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Bw_list.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Bw_list.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Dnssec_dnskey

Type: file.dnssec_dnskey

Short Description: dnssec dnskey file information and management commands

Long Description:

GUI Description:

File.Dnssec_dnskey.file

Type: string

Short Description: dnssec dnskey local file name

Long Description:

GUI Description:

File.Dnssec_dnskey.size

Type: int

Short Description: dnssec dnskey file size in byte

Long Description:

GUI Description:

File.Dnssec_dnskey.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Dnssec_dnskey.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Dnssec_dnskey.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Dnssec_ds

Type: file.dnssec_ds

Short Description: dnssec ds file information and management commands

Long Description:

GUI Description:

File.Dnssec_ds.file

Type: string

Short Description: dnssec ds local file name

Long Description:

GUI Description:

File.Dnssec_ds.size

Type: int

Short Description: dnssec ds file size in byte

Long Description:

GUI Description:

File.Dnssec_ds.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Dnssec_ds.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Dnssec_ds.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Auth_portal

Type: file.auth_portal

Short Description: auth portal file information and management commands

Long Description:

GUI Description:

File.Auth_portal.file

Type: string

Short Description: auth portal local file name

Long Description:

GUI Description:

File.Auth_portal.size

Type: int

Short Description: auth portal file size in byte

Long Description:

GUI Description:

File.Auth_portal.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Auth_portal.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Auth_portal.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Ip_map_list

Type: file.ip_map_list

Short Description: ip map list file information and management commands

Long Description:

GUI Description:

File.Ip_map_list.file

Type: string

Short Description: ip map list file name

Long Description:

GUI Description:

File.Ip_map_list.size

Type: int

Short Description: ip map list file size in byte

Long Description:

GUI Description:

File.Ip_map_list.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Ip_map_list.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Ip_map_list.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Local_uri_file

Type: file.local_uri_file

Short Description: local uri file information and management commands

Long Description:

GUI Description:

File.Local_uri_file.file

Type: string

Short Description: local uri file name

Long Description:

GUI Description:

File.Local_uri_file.size

Type: int

Short Description: file size in byte

Long Description:

GUI Description:

File.Local_uri_file.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Local_uri_file.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Local_uri_file.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.License

Type: file.license

Short Description: license file information and management commands

Long Description:

GUI Description:

File.License.file

Type: string

Short Description: license local file name

Long Description:

GUI Description:

File.License.size

Type: int

Short Description: license file size in byte

Long Description:

GUI Description:

File.License.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.License.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.License.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Ssl_key

Type: file.ssl_key

Short Description: ssl key file information and management commands

Long Description:

GUI Description:

File.Ssl_key.file

Type: string

Short Description: ssl key local file name

Long Description:

GUI Description:

File.Ssl_key.size

Type: int

Short Description: ssl key file size in byte

Long Description:

GUI Description:

File.Ssl_key.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Ssl_key.csr_generate

Type: int

Short Description: Generate CSR file

Long Description:

GUI Description:

File.Ssl_key.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Ssl_key.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Ssl_cert

Type: file.ssl_cert

Short Description: ssl certificate file information and management commands

Long Description:

GUI Description:

File.Ssl_cert.file

Type: string

Short Description: ssl certificate local file name

Long Description:

GUI Description:

File.Ssl_cert.size

Type: int

Short Description: ssl certificate file size in byte

Long Description:

GUI Description:

File.Ssl_cert.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Ssl_cert.certificate_type

Type: string

Short Description:

Long Description:

GUI Description:

File.Ssl_cert.pfx_password

Type: string

Short Description: The password for certificate file (pfx type only)

Long Description:

GUI Description:

File.Ssl_cert.csr_generate

Type: int

Short Description: Generate CSR file

Long Description:

GUI Description:

File.Ssl_cert.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Ssl_cert.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Ssl_crl

Type: file.ssl_crl

Short Description: ssl crl file information and management commands

Long Description:

GUI Description:

File.Ssl_crl.file

Type: string

Short Description: ssl crl local file name

Long Description:

GUI Description:

File.Ssl_crl.size

Type: int

Short Description: ssl crl file size in byte

Long Description:

GUI Description:

File.Ssl_crl.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Ssl_crl.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Ssl_crl.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Axdebug

Type: file.axdebug

Short Description: axdebug file information and management commands

Long Description:

GUI Description:

File.Axdebug.file

Type: string

Short Description: axdebug local file name

Long Description:

GUI Description:

File.Axdebug.size

Type: int

Short Description: axdebug file size in byte

Long Description:

GUI Description:

File.Axdebug.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Axdebug.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Axdebug.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Debug_monitor

Type: file.debug_monitor

Short Description: debug monitor file information and management commands

Long Description:

GUI Description:

File.Debug_monitor.file

Type: string

Short Description: debug monitor local file name

Long Description:

GUI Description:

File.Debug_monitor.size

Type: int

Short Description: debug monitor file size in byte

Long Description:

GUI Description:

File.Debug_monitor.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Debug_monitor.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Debug_monitor.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Syslog

Type: file.syslog

Short Description: syslog file information and management commands

Long Description:

GUI Description:

File.Syslog.file

Type: string

Short Description: syslog local file name

Long Description:

GUI Description:

File.Syslog.size

Type: int

Short Description: syslog file size in byte

Long Description:

GUI Description:

File.Syslog.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Syslog.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Syslog.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Health_postfile

Type: file.health_postfile

Short Description: Address the HTTP Post data file

Long Description:

GUI Description:

File.Health_postfile.file

Type: string

Short Description: Specify the File Name

Long Description:

GUI Description:

File.Health_postfile.size

Type: int

Short Description: syslog file size in byte

Long Description:

GUI Description:

File.Health_postfile.file_handle

Type: string

Short Description: full path of the uploaded file

Long Description:

GUI Description:

File.Health_postfile.action

Type: string

Short Description: Specific action when aXAPI POST or PUT method is given

Long Description:

GUI Description:

File.Health_postfile.dst_file

Type: string

Short Description: destination file name for copy and rename action

Long Description:

GUI Description:

File.Health_external

Type: file.health_external

Short Description: Address the External Script Program

Long Description:

GUI Description:

File.Health_external.file

Type: string

Short Description: {u’minLength’: 1, u’maxLength’: 63, u’type’: u’string’, u’description’: u’Describe the Program Function briefly’, u’format’: u’string’}

Long Description:

GUI Description:

File.Health_external.size

Type: int

Short Description: {u’minLength’: 1, u’maxLength’: 63, u’type’: u’string’, u’description’: u’Describe the Program Function briefly’, u’format’: u’string’}

Long Description:

GUI Description:

File.Health_external.description

Type: string

Short Description: {u’minLength’: 1, u’maxLength’: 63, u’type’: u’string’, u’description’: u’Describe the Program Function briefly’, u’format’: u’string’}

Long Description:

GUI Description:

File.Health_external.file_handle

Type: string

Short Description: {u’minLength’: 1, u’maxLength’: 63, u’type’: u’string’, u’description’: u’Describe the Program Function briefly’, u’format’: u’string’}

Long Description:

GUI Description:

File.Health_external.action

Type: string

Short Description: {u’minLength’: 1, u’maxLength’: 63, u’type’: u’string’, u’description’: u’Describe the Program Function briefly’, u’format’: u’string’}

Long Description:

GUI Description:

File.Health_external.dst_file

Type: string

Short Description: {u’minLength’: 1, u’maxLength’: 63, u’type’: u’string’, u’description’: u’Describe the Program Function briefly’, u’format’: u’string’}

Long Description:

GUI Description: