All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| attachFirewallToVMs | POST /core/firewalls/{firewall_id}/update-attachments | Attach Firewalls to VMs |
ResponseModel attachFirewallToVMs(firewallId, payload)
Attach Firewalls to VMs
Attach a firewall to one or more virtual machines by providing the virtual machine IDs in the request body and the firewall ID in the path. For more information, click here.
import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
let apiInstance = new HyperstackApi.FirewallAttachmentApi();
let firewallId = 56; // Number |
let payload = new HyperstackApi.AttachFirewallWithVM(); // AttachFirewallWithVM |
apiInstance.attachFirewallToVMs(firewallId, payload).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| firewallId | Number | ||
| payload | AttachFirewallWithVM |
- Content-Type: application/json
- Accept: application/json