Create Import-Based Discovery Rule for Windows
You can create a rule for Microsoft Windows computers based on a list of IP addresses and DNS names.
Required Privileges
To perform this task, a user must have one of the following roles assigned: Portal Administrator, Service Provider Global Administrator, Service Provider Administrator, Company Owner, Company Administrator.
Request
To create an import-based rule for Microsoft Windows computers, send the POST HTTP request to the URL of the /discovery/windows/rules/custom resource.
HTTP Request
POST https://<hostname>:1280/api/v3/discovery/windows/rules/custom |
Request Headers
The request contains the following headers.
Header | Required/Optional | Value | Description |
Authorization | Required | Bearer <Access-Token> | Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format. |
Content-Type | Required | application/json | Identifies a media type that is used in the body of the request. |
Accept | Optional | application/json | Specifies a media type of representation that is required in the response message. If the requested type is not supported, the server will return the response in the application/json media type. |
Request parameters
A list of parameters that are applicable for this operation:
Name | In | Type | Required | Default | Description |
---|---|---|---|---|---|
Body | Body | Yes | — | Discovery rule properties |
Response
The server returns the following response to the client.
Response Code
A successfully completed operation returns response code 200 OK.
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTP headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the request body message: application/json; charset=utf-8 |
Response Body
In the response body, Veeam Service Provider Console returns a created resource representation based on the WindowsCustomDiscoveryRule schema.
Example
The following request creates a new import-based discovery rule for Microsoft Windows computers.
Request: POST https://localhost:1280/api/v3/discovery/windows/rules/custom
Request Header: Content-type: application/json Authorization: Bearer <Access-Token>
Request Body: { "name": "Import-Based Discovery Rule", "masterAgentUid": "079f55ce-8f99-43a4-9198-47f41cd28e2d", "hosts": [ "172.16.21.134", "172.16.21.161", "172.16.21.168", "172.16.21.172" ], "accessAccount": { "userName": "srv04\administrator", "password": "Password1" }, "filter": { "exclusionMask": [], "ignoreInaccessibleMachine": true, "osTypes": [ "Workstation" ], "applications": [ "OtherApp" ], "platforms": [ "Physical" ] }, "notificationSettings": { "scheduleType": "Days", "scheduleTime": "08:00 AM", "scheduleDay": "Sunday", "to": "administrator@vspc.com", "subject": "VSPC Discovery Results" }, "deploymentSettings": { "isEnabled": true, "backupPolicyUid": "ef07d0be-9a19-40b3-92b8-be9fdf74df71", "setReadOnlyAccess": true } }
Response Code: 200 OK
Response Body: { "data": { "instanceUid": "a7aad5d6-cf06-4862-b47c-a917970ac18d", "hosts": [ "172.16.21.134", "172.16.21.161", "172.16.21.168", "172.16.21.172" ] } } |