Automation DevOps

Part 2: ANF API 101 with Postman

Part 1: https://anfcommunity.com/2021/02/16/part-1-anf-api-101-with-postman

Note: between publishing of parts 1 and 2, Postman updated the UI. Some visuals and settings may have changed.

Now that we’ve setup Postman for ANF, we’ll continue with a simple GET command. Select the List ANF Accounts from the left column. Lets examine what is going on in the following screenshot.

You can see the exact management.azure.com URL has been filled out and the HTTP method has been set to GET. We are getting data from the API endpoint.

The selected environment (which includes all variables we’ve configured) is displayed in the top right corner (Azure NetApp Files NTAP).

When you hover over the URL variables, {{resourceGroupName}} in this example, you can see the current configured value (emea-core-west-europe-anf). Make sure all variables have the correct value.

We can also see a query parameter called api-version, which is appended to the request URL. This allows you to easily update the API version for all calls in the workspace.

We’ll now look at the authorization. Click on the Headers tab.

As you can see, we include an Authorization key, containing the {{token}} variable, which in turn points to our authorization token. The Content-Type header defines the content-type for the request body, however this only comes into play when sending data.

Hit the Send button top right.

If all goes well, the request returns a 200 OK status and the resulting data is displayed in the body field. Success!

Stay tuned for part 3 in which we’ll provision a volume through a PUT request.

1 comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: