Deployments¶
FTD configuration changes need to be deployed in order to take effect. Pending changes can be viewed, discarded or commited via the API.
-
class
firepyer.
Fdm
-
deploy_config
()¶ Checks if there’s any pending config changes and deploys them, waits until deploy finishes to return
- Returns
True if deployment was successful or not required, False if deployment failed
- Return type
bool
-
deploy_now
() → str¶ Starts a deployment, regardless of if there are any pending configuration changes
- Returns
The ID for the Deployment task
- Return type
str
>>> fdm.deploy_now() 'a4cacb2a-5102-11eb-aab5-9f6954baf492'
-
get_deployment_status
(deploy_id: str) → str¶ Gets the status of a Deployment task
- Parameters
deploy_id (str) – The ID of the Deployment task to check
- Raises
FirepyerResourceNotFound – If the deployment ID does not exist
- Returns
The status of the deployment, one of either [‘QUEUED’, ‘DEPLOYING’, DEPLOYED’, ‘FAILED’]
- Return type
str
>>> fdm.get_deployment_status('a4cacb2a-5102-11eb-aab5-9f6954baf492') 'DEPLOYED'
-
get_pending_changes
() → list¶ Gets any configuration changes that have not yet been deployed
- Returns
List of each change to be applied, empty list if there are none
- Return type
list
>>> fdm.get_pending_changes() [{'entityId': '3a89b463-4d44-11eb-9e04-bf71277f48e6', 'entityName': None, 'entityType': 'devicehostname', 'links': {'self': 'https://192.168.133.7/api/fdm/latest/operational/pendingchanges/'}, 'referencesAdded': [], 'referencesDeleted': [], 'type': 'entityupdate', 'valuesAdded': [], 'valuesDeleted': [], 'valuesUpdated': [{'fieldName': 'hostname', 'newValue': 'firepyer2120', 'oldValue': 'firepower', 'type': 'valueupdate'}]}, {'entityId': '5c405b75-5105-11eb-aab5-0140ccd4feb7', 'entityName': 'very-secure-rule', 'entityType': 'accessrule', 'links': {'self': 'https://192.168.133.7/api/fdm/latest/operational/pendingchanges/'}, 'referencesAdded': [], 'type': 'entitycreate', 'valuesAdded': [{'fieldName': 'logFiles', 'newValue': 'false', 'type': 'valueadd'}, {'fieldName': 'eventLogAction', 'newValue': 'LOG_NONE', 'type': 'valueadd'}, {'fieldName': 'ruleId', 'newValue': '268435505', 'type': 'valueadd'}, {'fieldName': 'name', 'newValue': 'very-secure-rule', 'type': 'valueadd'}]}, {'entityId': 'c78e66bc-cb57-43fe-bcbf-96b79b3475b3', 'entityName': 'NGFW-Access-Policy', 'entityType': 'accesspolicy', 'links': {'self': 'https://192.168.133.7/api/fdm/latest/operational/pendingchanges/'}, 'referencesAdded': [], 'referencesDeleted': [], 'type': 'entityupdate', 'valuesAdded': [], 'valuesDeleted': [], 'valuesUpdated': []}]
-