{"id":20887484,"url":"https://github.com/netscaler/ansible-nitro-api-calls","last_synced_at":"2025-08-02T11:34:57.774Z","repository":{"id":66953774,"uuid":"102715894","full_name":"netscaler/ansible-nitro-api-calls","owner":"netscaler","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-08T08:53:09.000Z","size":23,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-12T18:18:11.456Z","etag":null,"topics":["netscaler-automation-toolkit"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netscaler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-09-07T09:05:25.000Z","updated_at":"2024-03-26T12:35:47.000Z","dependencies_parsed_at":"2023-06-19T17:55:36.841Z","dependency_job_id":null,"html_url":"https://github.com/netscaler/ansible-nitro-api-calls","commit_stats":null,"previous_names":["netscaler/ansible-nitro-api-calls"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/netscaler/ansible-nitro-api-calls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netscaler%2Fansible-nitro-api-calls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netscaler%2Fansible-nitro-api-calls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netscaler%2Fansible-nitro-api-calls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netscaler%2Fansible-nitro-api-calls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netscaler","download_url":"https://codeload.github.com/netscaler/ansible-nitro-api-calls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netscaler%2Fansible-nitro-api-calls/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378992,"owners_count":24240915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["netscaler-automation-toolkit"],"created_at":"2024-11-18T08:20:21.772Z","updated_at":"2025-08-02T11:34:57.752Z","avatar_url":"https://github.com/netscaler.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible NITRO API calls\n\nThis repository contains sample playbooks that make NITRO API calls\nusing standard Ansible modules.\n\nEach playbook contains only one or two tasks. For more complete workflows tasks\nshould be combined in a more complete playbook. Such examples can be\nfound under the examples directory.\n\n\n## Playbook listing\n\nIn the following sections we detail the function of each playbook.\n\nAll playbooks require to be run with the `delegate_to: localhost` option\nsince we do not want Ansible to connect to Netscaler directly but instead\nrun the NITRO API calls from localhost addressed to the Netscaler NSIP.\n\nThere is a number of variables that each playbook uses. These are\ndefined withing each playbook.\n\nThe exception is the NITRO API credentials variables which are defined\nin the inventory file. These variables ( `{{ nsip }}`, `{{ nitro_user }}`,\n`{{ nitro_pass }}` ) are needed in all playbooks.\n\nFollowing are the details of each playbook.\n\n### Direct NetScaler API calls\n\nThese playbooks are under the `ns/` directory.\n\n#### ns\\_file\\_delete.yaml\n\nDeletes a file on Netscaler.\n\nVariables:\n\n* filelocation: path of the file on Netscaler\n* filename: name of the file on Netscaler\n\n#### ns\\_file\\_get.yaml\n\nRetrieve a file from Netscaler.\n\nVariables:\n\n* filelocation: path of the file on Netscaler.\n* filename: name of the file on Netscaler.\n* localfile: absolute path of the target saved local file.\n\n#### ns\\_file\\_put.yaml\n\nUpload a file to Netscaler.\n\nVariables:\n\n* filelocation: path of the file on Netscaler.\n* filename: name of the file on Netscaler.\n* localfile: absolute path of the source local file.\n\n\n#### ns\\_reboot.yaml\n\nReboot Netscaler.\n\nNote that this NITRO API call does not work with CPX.\nYou will need to use docker commands to restart the CPX container.\n\nVariables:\n\n* warm\\_reboot: boolean value to do a warm reboot.\n \n#### ns\\_resource\\_add.yaml\n\nAdd a configuration resource to Netscaler.\n\nVariables:\n\n* resource: path of the resource.\n* request\\_payload: request JSON content.\n\nRefer to NITRO reference documentation for variable values explanation.\n\n#### ns\\_resource\\_delete.yaml\n\nDelete a configuration resource on Netscaler.\n\nVariables:\n\n* resource: path of the resource.\n\nRefer to NITRO reference documentation for variable values explanation.\n\n#### ns\\_resource\\_enable\\_disable.yaml\n\nDisable a configuration resource on Netscaler.\n\nVariables:\n\n* resource: path of the resource.\n* request\\_payload: request JSON content.\n* resource\\_action: 'enable' / 'disable' the resource.\n\nRefer to NITRO reference documentation for variable values explanation.\n\n#### ns\\_resource\\_get.yaml\n\nGet details of a single configuration resource.\n\nVariables:\n\n* resource: path of the resource.\n\nThe returned data is under the `json` key in the playbook return value.\n\n\n#### ns\\_resource\\_get\\_all.yaml\n\nGet details of all resources of one kind.\n\nVariables:\n\n* resource: path of the resource.\n\nThe returned data is under the `json` key in the playbook return value.\n\n#### ns\\_resource\\_get\\_attrs.yaml\n\nGet specific attributes of a configuration resource.\n\nVariables:\n\n* resource: path of the resource.\n* attrs: list of attributes to retrieve.\n\nThe returned data is under the `json` key in the playbook return value.\n\n#### ns\\_resource\\_update.yaml\n\nUpdate the attributes of an existing resource.\n\n* resource: path of the resource.\n* request\\_payload: request JSON content.\n\n\n#### ns\\_save\\_running\\_config.yaml\n\nSave Netscaler's running configuration.\n\n\n#### ns\\_feature\n\nEnable / Disable Netscaler feature.\n\nVariables:\n\n* feature\\_action: determine the action to be performed. Valid values are `enable`, `disable`.\n* request\\_payload: request JSON content.\n\n\n### NetScaler NITRO API calls through MAS\n\nUnder the `playbooks/mas/` directory exist a number of\nplaybooks that configure a NetScaler instace through a\nMAS access point.\n\nIn this case we have to login to MAS to get an\nauthorization token which we use in the subsequent NITRO API\ncalls.\n\nTo inform MAS that the NITRO API call is directed to a managed\nNetScaler instance and not to MAS directly we have to include either\nof these HTTP request headers.\n\n* `_MPS_API_PROXY_MANAGED_INSTANCE_NAME`: Name of the managed instance.\n* `_MPS_API_PROXY_MANAGED_INSTANCE_IP`: IP address of the managed instance.\n* `_MPS_API_PROXY_MANAGED_INSTANCE_ID`: ID of the managed instance.\n\nIn the playbooks we use  `_MPS_API_PROXY_MANAGED_INSTANCE_IP` but any of the\nother headers are also suitable.\n\n  *Note* the `nsip`, `nitro_user` and `nitro_pass` variables must be set\n  to match the MAS ip address and NITRO API credentials. Once we get the login token\n  from MAS no other credentials are necessary.\n  Namely there is no need to use any of the managed NetScaler instances login credentials.\n\nThere exist the follwoing playbooks:\n\n* mas\\_ns\\_resource\\_add.yaml\n* mas\\_ns\\_resource\\_delete.yaml\n* mas\\_ns\\_resource\\_disable.yaml\n* mas\\_ns\\_resource\\_enable.yaml\n* mas\\_ns\\_resource\\_get.yaml\n* mas\\_ns\\_resource\\_get\\_all.yaml\n* mas\\_ns\\_resource\\_get\\_attrs.yaml\n* mas\\_ns\\_resource\\_update.yaml\n* mas\\_ns\\_save\\_running\\_config.yaml\n* mas\\_ns\\_feature\\_enable\\_disable.yaml\n* mas\\_ns\\_file\\_delete.yaml\n* mas\\_ns\\_file\\_get.yaml\n* mas\\_ns\\_file\\_put.yaml\n* mas\\_ns\\_reboot.yaml\n\nThe variables used and operations results are the same as\nthe similarly named NetScaler playbooks under `playbooks/ns/`.\n\nRefer to the corresponding NetScaler playbook for each one's\ndocumentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetscaler%2Fansible-nitro-api-calls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetscaler%2Fansible-nitro-api-calls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetscaler%2Fansible-nitro-api-calls/lists"}