5.1

Table Of Contents
3 Construct an ApiFilter element.
This ApiFilter overwrites any existing ApiFilter defined by the service. See the request portion of
“Example: Create an API Filter for an Extension Service,” on page 303 for information about the contents
of this element.
4 POST the ApiFilter element to the URL described in Step 2.
Example: Create an API Filter for an Extension Service
This request adds a new UrlPattern to set of patterns defined in the request portion of “Example: Register an
Extension Service,” on page 285. The request replaces the existing set of filter expressions with a new one that
includes the original set and one additional expression.
Request:
POST https://vcloud.example.com/api/admin/extension/service/45/apifilters
Content-type:application/vnd.vmware.admin.apiFilter+xml
<?xml version="1.0" encoding="UTF-8"?>
<vmext:ApiFilter>
<vmext:UrlPattern>(/api/org/.*/backups)|(/api/vApp/vapp-.*/backups)|
(/api/vApp/vapp-.*/action/backup)|(/api/backup/.*) |
(/api/vApp/vapp-.*/action/recoverBackup)</vmext:UrlPattern>
</vmext:ApiFilter>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.resourceClass+xml
...
<vmext:ApiFilter>
<vmext:UrlPattern>(/api/org/.*/backups)|(/api/vApp/vapp-.*/backups)|
(/api/vApp/vapp-.*/action/backup)|(/api/backup/.*) |
(/api/vApp/vapp-.*/action/recoverBackup)</vmext:UrlPattern>
</vmext:ApiFilter>
Create or Update an Extension Service API Definition
You can define an API for an extension service when you register the service. You can also create or update
the service API definition later.
An API definition for an extension service includes an API entry point (A URL at which a client can send
requests to the API) and a set of file descriptors, each of which consists of a description and a reference to a
schema definition file.
An ApiDefinition element must contain the following child elements:
EntryPoint
The URL to which a client can send requests to the service API. This can be any
URL, and can include the variable {baseUri}, which represents the
vCloud Director REST API base URL.
Namespace
The service namespace. See “Register an Extension Service,” on page 284
Files
One or more references to schema definition files. The references must be
accessible to vCloud Director.
Prerequisites
Verify that you are logged in to the vCloud API as a system administrator.
Chapter 11 vCloud Director Extension Services
VMware, Inc. 303