In v12 you will need to run this as a task.
Find the status and the self link of the target policy:
$ curl -sku admin:admin https://155.121.lab.es.f5net.com/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q | jq '.active, .selfLink'
false
"https://localhost/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q?ver=12.1.3"
Using the selfLink from the previous step start the task:
$ curl -sku admin:admin -X POST -d '{"policyReference": { "link": "https://155.121.lab.es.f5net.com/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q?ver=12.1.3"}}' https://155.121.lab.es.f5net.com/mgmt/tm/asm/tasks/apply-policy | jq .
{
"kind": "tm:asm:tasks:apply-policy:apply-policy-taskstate",
"selfLink": "https://localhost/mgmt/tm/asm/tasks/apply-policy/42ZU2wkHI2BLOCx6VYNsVA?ver=12.1.3",
"policyReference": {
"link": "https://localhost/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q?ver=12.1.3"
},
"status": "NEW",
"id": "42ZU2wkHI2BLOCx6VYNsVA",
"startTime": "2018-06-05T15:22:25Z",
"lastUpdateMicros": 1528212145000000
}
Validate the task has completed:
$ curl -sku admin:admin https://155.121.lab.es.f5net.com/mgmt/tm/asm/tasks/apply-policy?\$filter=id%20eq%20\'42ZU2wkHI2BLOCx6VYNsVA\' | jq .
{
"kind": "tm:asm:tasks:apply-policy:apply-policy-taskcollectionstate",
"selfLink": "https://localhost/mgmt/tm/asm/tasks/apply-policy?ver=12.1.3&$filter=id%20eq%20'42ZU2wkHI2BLOCx6VYNsVA'",
"totalItems": 1,
"items": [
{
"status": "COMPLETED",
"lastUpdateMicros": 1528212157000000,
"selfLink": "https://localhost/mgmt/tm/asm/tasks/apply-policy/42ZU2wkHI2BLOCx6VYNsVA?ver=12.1.3",
"kind": "tm:asm:tasks:apply-policy:apply-policy-taskstate",
"policyReference": {
"link": "https://localhost/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q?ver=12.1.3"
},
"endTime": "2018-06-05T15:22:38Z",
"startTime": "2018-06-05T15:22:25Z",
"id": "42ZU2wkHI2BLOCx6VYNsVA"
}
]
}
Validate the policy has been activated:
$ curl -sku admin:admin https://155.121.lab.es.f5net.com/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q | jq '.active, .selfLink'
true
"https://localhost/mgmt/tm/asm/policies/Fqpvw5rn1SzYqgrCR9CA1Q?ver=12.1.3"
Please let me know if this addresses your question.