Jump to content
wildweaselmi

Postman and AS3

Recommended Posts

In the process of migrating applications from our Legacy environment to new LTMs using Postman and AS3.  This topic will briefly discuss how and share some scripts but not going to get in detail.

  • Using Postman 7.2.2 on Mac
  • BIG-IQ 6.x

NOTE: You can not use dash (-) or period (.) and must only use underscore (_) as a way to separate

First define environment variables

Variables_CorpTech_Dev1.thumb.png.7bd1acbd1a9024783d7b05d29bcd907d.png

Next create request called Create_App

Body

{
  "class": "AS3",
  "action": "deploy",
  "persist": true,
  "declaration": {
    "class": "ADC",
    "schemaVersion": "3.7.0",
    "id": "vs_si_camaro_dev_int_mwg_com_https",
    "label": "AS3_app",
    "remark": "Created_using_AS3",
    "target": { "address": "{{bigip_ip_address}}" },
    "tenant_103035": {
      "class": "Tenant",
      "defaultRouteDomain": 0,
      "si_camaro_dev": {
        "class": "Application",
        "template": "generic",
        "si_camaro_dev_vs": {
          "class": "Service_HTTP",
          "metadata": {
            "application_contact_email": { "value": "CAMARO@mwg.com" }
          },
          "virtualAddresses": ["10.47.69.57"],
          "virtualPort": 80,
          "snat": { "bigip": "/Common/SNATS_CORPTECH_DEV1" },
          "pool": "si_camaro_dev_pool",
          "profileHTTP": { "use": "si_camaro_dev_http_p" },
          "profileTCP": { "use": "si_camaro_dev_tcp_p" },
          "profileAnalytics": { "use": "si_camaro_dev_analytics" },
          "persistenceMethods": [{ "use": "si_camaro_dev_persist" }]
        },
        "si_camaro_dev_analytics": {
          "collectGeo": true,
          "collectIp": true,
          "collectMaxTpsAndThroughput": true,
          "collectPageLoadTime": true,
          "collectSubnet": true,
          "collectUrl": true,
          "collectUserAgent": true,
          "collectUserSession": true,
          "remark": "Capture ALL analytics for virtual servers with http profile",
          "notificationBySnmp": false,
          "class": "Analytics_Profile"
        },
        "si_camaro_dev_http_p": { "class": "HTTP_Profile" },
        "si_camaro_dev_tcp_p": { "class": "TCP_Profile" },
        "si_camaro_dev_persist": {
          "class": "Persist",
          "persistenceMethod": "cookie"
        },
        "si_camaro_dev_pool": {
          "class": "Pool",
          "monitors": [{ "bigip": "/Common/http" }],
          "loadBalancingMode": "least-connections-member",
          "slowRampTime": 300,
          "members": [
            {
              "servicePort": 80,
              "shareNodes": true,
              "serverAddresses": ["10.47.40.49"]
            }
          ]
        }
      }
    }
  }
}

Authorization (utilizing the variables you entered in STEP 1 above.

Username: {{user}}
Password: {{password}}

Request Type (using the variables you entered in STEP 1 above.

POST: https://{{bigiq_ip_address}}/mgmt/shared/appsvcs/declare?async=true

Click Save and Send

When you click Send you will get a message (output) that includes code that you will use to find status but lets create the STATUS request first.

***************************************

Create request called Status_App

Authorization (utilizing the variables you entered in STEP 1 above.

Username: {{user}}
Password: {{password}}

Request Type (using the variables you enter

GET: https://{{bigiq_ip_address}}/mgmt/shared/appsvcs/task/<insert copied code from post>

***************************************

Create request called Delete_App

Authorization

Username: {{user}}
Password: {{password}}

Body

{
    "class": "AS3",
   
    "declaration": {
              "id": "103035",
              "schemaVersion": "3.7.0",
        "class": "ADC",
        "target": {
            "address": "{{bigip_ip_address}}"
        },
        "tenant_103035": {
            "class": "Tenant"
        }
    }
}

Request Type

POST: https://{{bigiq_ip_address}}/mgmt/shared/appsvcs/declare?async=true

***************************************

Create request called Read_App

Authorization

Username: {{user}}
Password: {{password}}

Request Type

GET: https://{{bigiq_ip_address}}/mgmt/shared/appsvcs/declare/{{TENANT}}

**************************************

Share this post


Link to post
Share on other sites

×
×
  • Create New...