You are here

public function VclHandler::getSnippetId in Fastly 8.3

Fetch Id of a snippet.

@data array

Return value

int Snippet Id.

1 call to VclHandler::getSnippetId()
VclHandler::removeImageOptimization in src/VclHandler.php
Remove Image optimization feature.

File

src/VclHandler.php, line 670

Class

VclHandler
Class to control the VCL handling.

Namespace

Drupal\fastly

Code

public function getSnippetId($data) {
  $url = $this->versionBaseUrl . '/' . $this->lastClonedVersion . '/snippet/' . $data['name'];
  $response = $this
    ->vclGetWrapper($url);
  $responseData = json_decode($response
    ->getBody());
  return $responseData->id;
}