You can create a MAC Set (a group of MAC addresses) and then add this group as the source or destination in a Layer 2 (Ethernet) rule for the distributed firewall. Additionally, you can update and delete MAC Sets by using the API.
1 |
Log in to vCloud Air as an administrator. See Log in to vCloud Air for information. |
2 |
Create a login session with vCloud Director. See Create a Session for a Virtual Data Center in a Service for information. |
1 | To get the details about the MAC Sets configured for an edge gateway, issue the following request: GET https://vchs.vmware.com/hybridity/api/scope/scopeId/macsets/[macsetId] In the request header, include the OATH token and the Accept header that you obtained when creating a login session: Accept: application/json Content-Type: application/json X-Vcloud-Authorization: "vcloud-auth-token" If the request is successful, the server returns HTTP response code 200 and the details of the MAC Set configuration. |
2 | To create a MAC Set, submit a POST request using the following request header: POST https://vchs.vmware.com/hybridity/api/scope/scopeId/macsets In the request header, include the OATH token and the Accept header that you obtained when creating a login session: Accept: application/json Content-Type: application/json X-Vcloud-Authorization: vcloud-auth-token Include the following elements in the request body: { "objectId": "string", "revision": number, "name": "string", "description": "string", "scope" : [ { "id" : "string", "name" : "string", "objectType" : "string", }, ] "value" : "string" } For a description of each element, see Schema for IP Sets and MAC Sets. |
3 | To delete a MAC Set, issue the following DELETE request. (Include the MAC Set ID you obtained in the previous step.) DELETE https://vchs.vmware.com/hybridity/api/scope/scopeId/macsets/macsetId In the request header, include the OATH token and the Accept header that you obtained when creating a login session. The server returns status 204 NO CONTENT in the response header. The server does not return a response body. |