diff --git a/docs/how_to_use.md b/docs/how_to_use.md index 7925d2d9e03f005c601fc0089cad0a003f169630..1b3132901198ca78a6607dc54d7777415fcb01c4 100644 --- a/docs/how_to_use.md +++ b/docs/how_to_use.md @@ -74,3 +74,39 @@ Rules: - The "structure_name" must be a list. - Each field in the list must be a dictionary. - Each field must contain `type` and `required` keys. + +### CreateVirtualMachine API body template: +The user can use the API endpoint CreateVirtualMachine to create a virtual machine and all the related objects just like what happens when the form is used. +The next template can be used to help fill all the required information: + +```json +{ + "provider_type": 1, + "provider": 1, + "name": "VM Name", + "status": "active", + "owner": 1, + "platform": 1, + "description": "VM description", + "virtual_machine_type": 1, + "interface_name": "mock", + "ip_addresses": "192.168.1.10/24", + "ip_addresses_status": "active", + "gateway": "193.168.1.10/24", + "gateway_status": "active", + "domain_names": {"example_domain_name": "vm.example.com"}, + "extra_config_structure": 1, + "extra_config_values": {"vpc_id": "string","ssh_key": "string","assign_public_ip": "true","security_group_id": "string"}, + "ntp_service_name": "ntp server", + "ntp_service_protocol": "tcp", + "ntp_service_ports": "33", + "dns_service_name": "dns server", + "dns_service_protocol": "tcp", + "dns_service_ports": "44", + "syslog_service_name": "syslog server", + "syslog_service_protocol": "tcp", + "syslog_service_ports": "33", + "tag":1 +} +``` +When an integer is mentioned, for example, `"provider_type": 1`, the value should be the ID of the object that corresponds to that information. In this example, it's the ID of the `cluster type`. The values in the template are just examples. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b6a3d01d0abc80e6522eae38fe753c19120c63a2..71c6eb6884fb27eeae9ea6ca96f2f93d0428a500 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "netbox-sys-plugin" -version = "1.1.1" +version = "1.2.0" authors = ["Frederico Sequeira", "Magdalena Gomez", "Vincent Simonin",] maintainers = []