Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Latest commit

 

History

History
828 lines (584 loc) · 27.1 KB

ProjectApi.md

File metadata and controls

828 lines (584 loc) · 27.1 KB

Looker\ProjectApi

All URIs are relative to https://ethosce.looker.com:19999/api/3.1

Method HTTP request Description
allGitBranches GET /projects/{project_id}/git_branches Get All Git Branchs
allGitConnectionTests GET /projects/{project_id}/git_connection_tests Get All Git Connection Tests
allProjectFiles GET /projects/{project_id}/files Get All Project Files
allProjects GET /projects Get All Projects
createGitDeployKey POST /projects/{project_id}/git/deploy_key Create Deploy Key
createProject POST /projects Create Project
gitDeployKey GET /projects/{project_id}/git/deploy_key Git Deploy Key
project GET /projects/{project_id} Get Project
projectFile GET /projects/{project_id}/files/file Get Project File
projectValidationResults GET /projects/{project_id}/validate Cached Project Validation Results
projectWorkspace GET /projects/{project_id}/current_workspace Get Project Workspace
resetProjectToProduction POST /projects/{project_id}/reset_to_production Reset To Production
resetProjectToRemote POST /projects/{project_id}/reset_to_remote Reset To Remote
runGitConnectionTest GET /projects/{project_id}/git_connection_tests/{test_id} Run Git Connection Test
updateProject PATCH /projects/{project_id} Update Project
validateProject POST /projects/{project_id}/validate Validate Project

allGitBranches

\Looker\Model\GitBranch[] allGitBranches($project_id)

Get All Git Branchs

Get All Git Branches Returns a list of git branches in the project repository

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id

try {
    $result = $apiInstance->allGitBranches($project_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->allGitBranches: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id

Return type

\Looker\Model\GitBranch[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

allGitConnectionTests

\Looker\Model\GitConnectionTest[] allGitConnectionTests($project_id)

Get All Git Connection Tests

Get All Git Connection Tests Returns a list of tests which can be run against a project's git connection

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id

try {
    $result = $apiInstance->allGitConnectionTests($project_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->allGitConnectionTests: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id

Return type

\Looker\Model\GitConnectionTest[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

allProjectFiles

\Looker\Model\ProjectFile[] allProjectFiles($project_id, $fields)

Get All Project Files

Get All Project Files Returns a list of the files in the project

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->allProjectFiles($project_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->allProjectFiles: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
fields string Requested fields [optional]

Return type

\Looker\Model\ProjectFile[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

allProjects

\Looker\Model\Project[] allProjects($fields)

Get All Projects

Get All Projects Returns all projects visible to the current user

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->allProjects($fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->allProjects: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
fields string Requested fields [optional]

Return type

\Looker\Model\Project[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createGitDeployKey

string createGitDeployKey($project_id)

Create Deploy Key

Create Git Deploy Key Create a public/private key pair for authenticating ssh git requests from Looker to a remote git repository for a particular Looker project. Returns the public key of the generated ssh key pair. Copy this public key to your remote git repository's ssh keys configuration so that the remote git service can validate and accept git requests from the Looker server.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id

try {
    $result = $apiInstance->createGitDeployKey($project_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->createGitDeployKey: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createProject

\Looker\Model\Project createProject($body)

Create Project

Create A Project dev mode required. - Call update_session to select the 'dev' workspace. name is required. git_remote_url is not allowed. To configure Git for the newly created project, follow the instructions in update_project.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \Looker\Model\Project(); // \Looker\Model\Project | Project

try {
    $result = $apiInstance->createProject($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->createProject: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Looker\Model\Project Project [optional]

Return type

\Looker\Model\Project

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

gitDeployKey

string gitDeployKey($project_id)

Git Deploy Key

Git Deploy Key Returns the ssh public key previously created for a project's git repository.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id

try {
    $result = $apiInstance->gitDeployKey($project_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->gitDeployKey: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

project

\Looker\Model\Project project($project_id, $fields)

Get Project

Get A Project Returns the project with the given project id

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->project($project_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->project: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
fields string Requested fields [optional]

Return type

\Looker\Model\Project

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

projectFile

\Looker\Model\ProjectFile projectFile($project_id, $file_id, $fields)

Get Project File

Get Project File Info Returns information about a file in the project

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$file_id = "file_id_example"; // string | File Id
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->projectFile($project_id, $file_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->projectFile: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
file_id string File Id
fields string Requested fields [optional]

Return type

\Looker\Model\ProjectFile

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

projectValidationResults

\Looker\Model\ProjectValidationCache projectValidationResults($project_id, $fields)

Cached Project Validation Results

Get Cached Project Validation Results Returns the cached results of a previous project validation calculation, if any. Returns http status 204 No Content if no validation results exist. Validating the content of all the files in a project can be computationally intensive for large projects. Use this API to simply fetch the results of the most recent project validation rather than revalidating the entire project from scratch. A value of \"stale\": true in the response indicates that the project has changed since the cached validation results were computed. The cached validation results may no longer reflect the current state of the project.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->projectValidationResults($project_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->projectValidationResults: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
fields string Requested fields [optional]

Return type

\Looker\Model\ProjectValidationCache

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

projectWorkspace

\Looker\Model\ProjectWorkspace projectWorkspace($project_id, $fields)

Get Project Workspace

Get Project Workspace Returns information about the state of the project files in the currently selected workspace

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->projectWorkspace($project_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->projectWorkspace: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
fields string Requested fields [optional]

Return type

\Looker\Model\ProjectWorkspace

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resetProjectToProduction

string resetProjectToProduction($project_id)

Reset To Production

Reset a project to the revision of the project that is in production. DANGER this will delete any changes that have not been pushed to a remote repository.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Id of project

try {
    $result = $apiInstance->resetProjectToProduction($project_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->resetProjectToProduction: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Id of project

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resetProjectToRemote

string resetProjectToRemote($project_id)

Reset To Remote

Reset a project development branch to the revision of the project that is on the remote. DANGER this will delete any changes that have not been pushed to a remote repository.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Id of project

try {
    $result = $apiInstance->resetProjectToRemote($project_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->resetProjectToRemote: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Id of project

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

runGitConnectionTest

\Looker\Model\GitConnectionTestResult runGitConnectionTest($project_id, $test_id)

Run Git Connection Test

Run a git connection test Run the named test on the git service used by this project and return the result. This is intended to help debug git connections when things do not work properly, to give more helpful information about why a git url is not working with Looker. They are intended to be run in the order they are returned from the /projects/ID/git_connection_tests endpoint.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$test_id = "test_id_example"; // string | Test Id

try {
    $result = $apiInstance->runGitConnectionTest($project_id, $test_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->runGitConnectionTest: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
test_id string Test Id

Return type

\Looker\Model\GitConnectionTestResult

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateProject

\Looker\Model\Project updateProject($project_id, $body, $fields)

Update Project

Update Project Configuration Apply changes to a project's configuration. #### Configuring Git for a Project To set up a Looker project with a remote git repository, follow these steps: 1. Call update_session to select the 'dev' workspace. 1. Call create_git_deploy_key to create a new deploy key for the project 1. Copy the deploy key text into the remote git repository's ssh key configuration 1. Call update_project to set project's git_remote_url ()and git_service_name, if necessary). When you modify a project's git_remote_url, Looker connects to the remote repository to fetch metadata. The remote git repository MUST be configured with the Looker-generated deploy key for this project prior to setting the project's git_remote_url. To set up a Looker project with a git repository residing on the Looker server (a 'bare' git repo): 1. Call update_session to select the 'dev' workspace. 1. Call update_project setting git_remote_url to nil and git_service_name to "bare".

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$body = new \Looker\Model\Project(); // \Looker\Model\Project | Project
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->updateProject($project_id, $body, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->updateProject: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
body \Looker\Model\Project Project
fields string Requested fields [optional]

Return type

\Looker\Model\Project

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

validateProject

\Looker\Model\ProjectValidation validateProject($project_id, $fields)

Validate Project

Validate Project Performs lint validation of all lookml files in the project. Returns a list of errors found, if any. Validating the content of all the files in a project can be computationally intensive for large projects. For best performance, call validate_project(project_id) only when you really want to recompute project validation. To quickly display the results of the most recent project validation (without recomputing), use project_validation_results(project_id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Looker\Api\ProjectApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$project_id = "project_id_example"; // string | Project Id
$fields = "fields_example"; // string | Requested fields

try {
    $result = $apiInstance->validateProject($project_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectApi->validateProject: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project Id
fields string Requested fields [optional]

Return type

\Looker\Model\ProjectValidation

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]