@@ -12,7 +12,7 @@ composer require keboola/notification-api-php-client
1212
1313``` php
1414use Keboola\NotificationClient\EventsClient;
15- use Keboola\NotificationClient\Requests\PostEvent\FailedJobEventData ;
15+ use Keboola\NotificationClient\Requests\PostEvent\JobFailedEventData ;
1616use Keboola\NotificationClient\Requests\PostEvent\JobData;
1717use Keboola\NotificationClient\Requests\Event;
1818use Psr\Log\NullLogger;
@@ -23,10 +23,11 @@ $client = new EventsClient(
2323 'xxx-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
2424);
2525$client->postEvent(
26- new Event(
27- 'job_failed',
28- new FailedJobEventData(
29- 'job failed',
26+ new Event(
27+ new JobFailedEventData(
28+ '123',
29+ 'My Project',
30+ 'Job finished with error',
3031 new JobData('my-project', '123', 'http://someUrl', '2020-01-02', '2020-01-01', 'my-orchestration')
3132 )
3233 )
@@ -68,7 +69,8 @@ $clientFactory->getEventsClient('xxx-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
6869
6970- Set the following environment variables in ` set-env.sh` file (use ` set-env.template.sh` as sample):
7071 - ` STORAGE_API_URL` - Keboola Connection URL to arbitrary stack where the notification service is registered.
71- - ` TEST_STORAGE_API_TOKEN` - Token to a test project.
72+ - ` TEST_STORAGE_API_TOKEN` - Token to a test project.
73+ - ` TEST_STORAGE_API_PROJECT_ID` - Project ID of the test project.
7274 - ` TEST_MANAGE_API_APPLICATION_TOKEN` - Application token with scope ` notifications:push-event` .
7375
7476- Set one of Azure or AWS resources (or both, but only one is needed).
@@ -111,18 +113,19 @@ $clientFactory->getEventsClient('xxx-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
111113 SERVICE_PRINCIPAL_ID=$( az ad sp list --display-name testing-notification-api-php-client --query " [0].objectId" --output tsv)
112114 ` ` `
113115
114- - Deploy the key vault , provide tenant ID, service principal ID and group ID from the previous commands:
116+ - Deploy the Storage Account for logs , provide tenant ID, service principal ID and group ID from the previous commands:
115117 ` ` ` bash
116- az deployment group create --resource-group testing-job-queue- api-php-client --template-file provisioning/azure.json --parameters vault_name=test-job-queue -client tenant_id=$TEST_AZURE_TENANT_ID service_principal_object_id=$SERVICE_PRINCIPAL_ID
118+ az deployment group create --resource-group testing-notification- api-php-client --template-file provisioning/azure.json --parameters vault_name=test-notification -client tenant_id=$TEST_AZURE_TENANT_ID service_principal_object_id=$SERVICE_PRINCIPAL_ID
117119 ` ` `
118120
119- - Show Key Vault URL
121+ - Get the connection string
120122 ` ` ` bash
121- az keyvault show --name test-job-queue- client -- query " properties.vaultUri " --output tsv
123+ az storage account show-connection-string -g testing-notification-api-php- client -n mirontfcnacc2 -- query " connectionString " --output tsv
122124 ` ` `
123125
124- returns e.g. ` https://test-job-queue-client.vault.azure.net/` , use this to set values in ` set-env.sh` file:
125- - ` test_azure_key_vault_url` - https://test-job-queue-client.vault.azure.net/
126+ Set the connection string and container name you provided as parameter to the create command to following environment variables in the ` set-env.sh` file:
127+ - AZURE_LOGS_ABS_CONTAINER
128+ - AZURE_LOGS_ABS_CONNECTION_STRING
126129
127130# # Generate environment configuration
128131
0 commit comments