PHP code example of keboola / job-queue-api-php-client

1. Go to this page and download the library: Download keboola/job-queue-api-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

keboola / job-queue-api-php-client example snippets


use Keboola\JobQueueClient\Client;
use Keboola\JobQueueClient\JobData;use Psr\Log\NullLogger;

$client = new Client(
    new NullLogger(),
    'http://queue.conenection.keboola.com/',
    'xxx-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
);
$result = $client->createJob(new JobData(
    'keboola.ex-db-snowflake',
    '123',
    [],
    'run'
));
var_dump($result['id']);
json 
    {
      "appId": "268a6f05-xxxxxxxxxxxxxxxxxxxxxxxxxxx", //-> test_azure_client_id
      "displayName": "testing-job-queue-internal-api-php-client",
      "name": "http://testing-job-queue-internal-api-php-client",
      "password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", //-> test_azure_client_secret
      "tenant": "9b85ee6f-xxxxxxxxxxxxxxxxxxxxxxxxxxx" //-> test_azure_tenant_id
    }
    
bash
export db_password="cm9vdA==" #root
export db_password_urlencoded="cm9vdA=="
export test_azure_client_secret_base64=$(printf "%s" "$test_azure_client_secret"| base64 --wrap=0)
export test_aws_secret_access_key_base64=$(printf "%s" "$test_aws_secret_access_key"| base64 --wrap=0)

./set-env.sh
envsubst < provisioning/environments.yaml.template > provisioning/environments.yaml
kubectl apply -f ./provisioning/environments.yaml
kubectl apply -f ./provisioning/public-api.yaml
queue_public_api_ip=`kubectl get svc --output jsonpath --template "{.items[?(@.metadata.name==\"dev-job-queue-api-service\")].status.loadBalancer.ingress[].ip}" --namespace=dev-job-queue-api-php-client`

echo "queue_public_api_url: http://$(queue_public_api_ip):94"