Description
The addSRUFileUpload operation handles configuration related to SRUFileUpload model.
HTTP request
POST /api/fdm/v6/action/updatesrufromfile
Data Parameters
Parameter | Required | Type | Description | |||
---|---|---|---|---|---|---|
name | False | string | Name of the file to be installed | |||
fileName | False | string | Name of the file to be installed Field level constraints: must match pattern ^((?!;).)*$. (Note: Additional constraints might exist) |
|||
checkSum | False | string | SHA-512 sum of the package Field level constraints: must match pattern ^[a-fA-F0-9]{128}$. (Note: Additional constraints might exist) |
|||
uploadOnly | False | boolean | set to true if the file was not intended to be installed | |||
allowDowngrade | False | boolean | set to true if downgrade is allowed | |||
type | True | string | srufileupload |
Example
curl -X POST \
--header "Accept: application/json" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"allowDowngrade": true,
"checkSum": "string",
"fileName": "string",
"id": "string",
"name": "string",
"type": "srufileupload",
"uploadOnly": true,
"version": "string"
}' \
"https://${HOST}:${PORT}/api/fdm/v6/action/updatesrufromfile"
from bravado.requests_client import RequestsClient
from bravado.client import SwaggerClient
def get_client(host, token):
http_client = RequestsClient()
http_client.ssl_verify = False
http_client.set_api_key(
host,
"Bearer {}".format(token),
param_name="Authorization",
param_in="header"
)
return SwaggerClient.from_url(
"https://{}/apispec/ngfw.json".format(host),
http_client=http_client,
config={
"validate_responses": False,
"validate_swagger_spec": False
}
)
def add_sru_file_upload(client, body):
return client.SRUFileUpload.addSRUFileUpload(
body=body
).response().result
if __name__ == "__main__":
host = "ftd.example.com"
token = "access_token"
client = get_client(host, token)
body = {'allowDowngrade': True,
'checkSum': 'string',
'fileName': 'string',
'name': 'string',
'type': 'srufileupload',
'uploadOnly': True}
add_sru_file_upload(client, body)