In integration testing how can I ensure a required shared flow is deployed?

Suppose I have created new shared flow and attached to proxy . While integration testing how can I ensure share flow also deployed .Will it catch in Static code analysis tool?

Solved Solved
0 1 159
1 ACCEPTED SOLUTION

You could use following Management API for this purpose:

curl -i -u ${username}:${password} https://api.enterprise.apigee.com/v1/organizations/{organization}/apis/{shared-flow}/revisions/{revi...
{
    "aPIProxy": "{shared-flow}",
    "environment": [
        {
            "configuration": {
                "basePath": "/",
                "configVersion": "SHA-512:{sha-value}",
                "steps": []
            },
            "name": "prod",
            "server": [
                {
                    "pod": {
                        "name": "{message-processor-pod-name}",
                        "region": "us-central1"
                    },
                    "status": "deployed",
                    "type": [
                        "message-processor"
                    ],
                    "uUID": "{uuid}"
                },
                ...
                {
                    "pod": {
                        "name": "{router-pod-name}",
                        "region": "us-central1"
                    },
                    "status": "deployed",
                    "type": [
                        "router"
                    ],
                    "uUID": "{uuid}"
                },
                ...
            ],
            "state": "deployed"
        }
    ],
    "name": "{revision}",
    "organization": "{organization}"
}

Management API Reference:

https://apidocs.apigee.com/shared-flow-api/apis/get/organizations/%7Borg_name%7D/sharedflows/%7Bshar...

View solution in original post

1 REPLY 1

You could use following Management API for this purpose:

curl -i -u ${username}:${password} https://api.enterprise.apigee.com/v1/organizations/{organization}/apis/{shared-flow}/revisions/{revi...
{
    "aPIProxy": "{shared-flow}",
    "environment": [
        {
            "configuration": {
                "basePath": "/",
                "configVersion": "SHA-512:{sha-value}",
                "steps": []
            },
            "name": "prod",
            "server": [
                {
                    "pod": {
                        "name": "{message-processor-pod-name}",
                        "region": "us-central1"
                    },
                    "status": "deployed",
                    "type": [
                        "message-processor"
                    ],
                    "uUID": "{uuid}"
                },
                ...
                {
                    "pod": {
                        "name": "{router-pod-name}",
                        "region": "us-central1"
                    },
                    "status": "deployed",
                    "type": [
                        "router"
                    ],
                    "uUID": "{uuid}"
                },
                ...
            ],
            "state": "deployed"
        }
    ],
    "name": "{revision}",
    "organization": "{organization}"
}

Management API Reference:

https://apidocs.apigee.com/shared-flow-api/apis/get/organizations/%7Borg_name%7D/sharedflows/%7Bshar...