A python script to delete a batch of policies. The script is intended to run in a number of processes to delete policies in parallel.
`dmaapadp_api_function.sh`
A python script to delete a batch of policies. The script is intended to run in a number of processes to delete policies in parallel.
`dmaapadp_api_function.sh`
-`pa_api_functions.sh` \
-Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
+`a1pms_api_functions.sh` \
+Contains functions for adapting towards the Policy Management Service (A1PMS) API, also via dmaap (using a message-router stub interface)
`prodstub_api_functions.sh` \
Contains functions for adapting towards the Producer stub interface - simulates a producer.
`prodstub_api_functions.sh` \
Contains functions for adapting towards the Producer stub interface - simulates a producer.
-| `remote\|remote-remove docker\|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+] [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+] [--image-repo <repo-address>] [--repo-policy local\|remote] [--cluster-timeout <timeout-in-seconds>] [--print-stats]` |
+| `remote\|remote-remove docker\|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+] [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+] [--use-external-image <app-nam>+] [--image-repo <repo-address>] [--repo-policy local\|remote] [--cluster-timeout <timeout-in-seconds>] [--print-stats]` |
| `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
| `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
| `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
| `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
| `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
| `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
| `--image-repo` | Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
| `-repo-policy` | Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push only locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
| `--cluster-timeout` | Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
| `--image-repo` | Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
| `-repo-policy` | Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push only locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
| `--cluster-timeout` | Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
| `<config-file>`| Path to application.yaml |
| `<data-file>` | Optional path to application_configuration.json |
| `<config-file>`| Path to application.yaml |
| `<data-file>` | Optional path to application_configuration.json |
| `NOSDNC` | Configure without controller |
| `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
| `NOSDNC` | Configure without controller |
| `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the array length becomes equal to the target value or not.
See the 'cr' dir for more details.
Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the array length becomes equal to the target value or not.
See the 'cr' dir for more details.
| `<target-value>` | Target value for the length |
| `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
| `<target-value>` | Target value for the length |
| `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
To test the response code only, provide the response code parameter as well as the following three parameters.
Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
To test the response code only, provide the response code parameter as well as the following three parameters.
| `notification-url` | Url for notifications |
| `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
| `notification-url` | Url for notifications |
| `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
To test the the response code only, provide the expected response code and policy id.
Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
To test the the response code only, provide the expected response code and policy id.
| `transient` | Transient, true or false |
| `notification-url` | Url for notifications |
| `transient` | Transient, true or false |
| `notification-url` | Url for notifications |
Test of PUT '/policy' or V2 PUT '/policies'.
If more than one policy shall be created, add a count value to indicate the number of policies to create. Note that if more than one policy shall be created the provided policy-id must be numerical (will be used as the starting id).
Test of PUT '/policy' or V2 PUT '/policies'.
If more than one policy shall be created, add a count value to indicate the number of policies to create. Note that if more than one policy shall be created the provided policy-id must be numerical (will be used as the starting id).
| `<template-file>` | Path to the template file for the policy |
| `<count>` | An optional count (default is 1). If a value greater than 1 is given, the policy ids will use the given policy id as the first id and add 1 to that id for each new policy |
| `<template-file>` | Path to the template file for the policy |
| `<count>` | An optional count (default is 1). If a value greater than 1 is given, the policy ids will use the given policy id as the first id and add 1 to that id for each new policy |
-This tests the same as function 'api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
-If the agent api is not configured to use dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
-For arg list and parameters, see 'api_put_policy'.
+This tests the same as function 'a1pms_api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
+If the a1pms api is not configured to use dmaap (see 'use_a1pms_dmaap', 'use_a1pms_rest_http' and 'use_a1pms_rest_https'), an error message is printed.
+For arg list and parameters, see 'a1pms_api_put_policy'.
-This tests the same as function 'api_put_policy' except that the policy create is spread out over a number of processes and it only uses the agent rest API. The total number of policies created is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
+This tests the same as function 'a1pms_api_put_policy' except that the policy create is spread out over a number of processes and it only uses the a1pms rest API. The total number of policies created is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
| `<count-per-ric>` | Number of policies per ric |
| `<number-of-threads>` | Number of threads (processes) to run in parallel |
| `<count-per-ric>` | Number of policies per ric |
| `<number-of-threads>` | Number of threads (processes) to run in parallel |
| `<policy-id>` | Id of the policy |
| `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
| `<policy-id>` | Id of the policy |
| `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
-This tests the same as function 'api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
-If the agent api is not configured to used dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
-For arg list and parameters, see 'api_delete_policy'.
+This tests the same as function 'a1pms_api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
+If the a1pms api is not configured to used dmaap (see 'use_a1pms_dmaap', 'use_a1pms_rest_http' and 'use_a1pms_rest_https'), an error message is printed.
+For arg list and parameters, see 'a1pms_api_delete_policy'.
-This tests the same as function 'api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the agent rest API. The total number of policies deleted is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the deletion of all the policies in one ric.
+This tests the same as function 'a1pms_api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the a1pms rest API. The total number of policies deleted is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the deletion of all the policies in one ric.
| `<count-per-ric>` | Number of policies per ric |
| `<number-of-threads>` | Number of threads (processes) to run in parallel |
| `<count-per-ric>` | Number of policies per ric |
| `<number-of-threads>` | Number of threads (processes) to run in parallel |
Test of GET '/policy_ids' or V2 GET '/v2/policies'.
To test response code only, provide the response code parameter as well as the following three parameters.
Test of GET '/policy_ids' or V2 GET '/v2/policies'.
To test response code only, provide the response code parameter as well as the following three parameters.
| `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
| `<policy-instance-id>` | Id of the policy |
| `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
| `<policy-instance-id>` | Id of the policy |
Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
To test the response code only, provide the expected response code and policy type id.
Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
To test the response code only, provide the expected response code and policy type id.
| `<policy-type-id>` | Id of the policy type |
| `<schema-file>` | Path to the schema file for the policy type |
| `<policy-type-id>` | Id of the policy type |
| `<schema-file>` | Path to the schema file for the policy type |
Test of GET '/policy_schema' and optional check of the returned json schema.
To test the response code only, provide the expected response code and policy type id.
Test of GET '/policy_schema' and optional check of the returned json schema.
To test the response code only, provide the expected response code and policy type id.
| `<policy-type-id>` | Id of the policy type |
| `<schema-file>` | Path to the schema file for the policy type |
| `<policy-type-id>` | Id of the policy type |
| `<schema-file>` | Path to the schema file for the policy type |
Test of GET '/policy_schemas' and optional check of the returned json schemas.
To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
Test of GET '/policy_schemas' and optional check of the returned json schemas.
To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
| `<schema-file>` | Path to the schema file for the policy type |
| `NOFILE` | Indicate the template for an empty type |
| `<schema-file>` | Path to the schema file for the policy type |
| `NOFILE` | Indicate the template for an empty type |
| `<instance-status>` | Instance status |
| `<has-been-deleted>` | Deleted status, true or false |
| `<instance-status>` | Instance status |
| `<has-been-deleted>` | Deleted status, true or false |
Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
Test of GET '/ric' or V2 GET '/v2/rics/ric'
To test the response code only, provide the expected response code and managed element id.
Test of GET '/ric' or V2 GET '/v2/rics/ric'
To test the response code only, provide the expected response code and managed element id.
Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
| `NOTYPE>` | No type given |
| `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
| `NOTYPE>` | No type given |
| `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
To test only the response code, omit all parameters except the expected response code.
Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
To test only the response code, omit all parameters except the expected response code.
| `<response-code>` | Expected http response code |
| `<config-file>` | Path json config file to compare the retrieved config with |
| `<response-code>` | Expected http response code |
| `<config-file>` | Path json config file to compare the retrieved config with |
Admin reset to remove all policies and services
All types and instances etc are removed - types and instances in a1 sims need to be removed separately
NOTE - only works in kubernetes and the pod should not be running
Admin reset to remove all policies and services
All types and instances etc are removed - types and instances in a1 sims need to be removed separately
NOTE - only works in kubernetes and the pod should not be running