### Create Pod One-Step with Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Creates and starts a cloud pod, including app installation and configuration, in a single API call. Requires product ID, pod name, configuration code, phone template ID, image ID, resource type, and optionally a list of apps to install. Handles potential exceptions during the creation process. ```php setProductId("prod_12345") ->setPodName("quick-start-pod") ->setConfigurationCode("android_config_001") ->setPhoneTemplateId("template_001") ->setImageId("img_android_12") ->setResourceType(1) ->setStart(true); // Add apps to install $app1 = new AppListForCreatePodOneStepInput([ 'app_id' => 'app_001', 'version_code' => '1.2.0' ]); $app2 = new AppListForCreatePodOneStepInput([ 'app_id' => 'app_002', 'version_code' => '2.5.1' ]); $request->setAppList([$app1, $app2]); $response = $acepApi->createPodOneStep($request); echo "Pod created and started\n"; echo "Pod ID: " . $response->getResult()->getPodId() . "\n"; echo "Job ID: " . $response->getResult()->getJobId() . "\n"; } catch (Exception $e) { echo "Error in one-step creation: " . $e->getMessage() . "\n"; } // Expected output: // Pod created and started // Pod ID: pod_quick123 // Job ID: job_987654 ?> ``` -------------------------------- ### Start Recording Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Initiates screen recording for a pod instance with specified format, bitrate, frame rate, and resolution. ```APIDOC ## POST /api/recording/start ### Description Starts a screen recording session for a specified pod. ### Method POST ### Endpoint /api/recording/start ### Parameters #### Request Body - **PodId** (string) - Required - The ID of the pod for which to start recording. - **RecordingFormat** (string) - Optional - The format of the recording (e.g., "mp4"). Defaults to "mp4". - **Bitrate** (integer) - Optional - The desired bitrate in bits per second. - **FrameRate** (integer) - Optional - The desired frame rate. - **Resolution** (string) - Optional - The desired resolution (e.g., "1080p"). ### Request Example ```json { "PodId": "pod_abc123", "RecordingFormat": "mp4", "Bitrate": 2000000, "FrameRate": 30, "Resolution": "1080p" } ``` ### Response #### Success Response (200) - **Result** (object) - Contains the result of the start recording operation. - **RecordingId** (string) - The unique identifier for the recording session. - **StorageUrl** (string) - The URL where the recording will be stored. #### Response Example ```json { "Result": { "RecordingId": "rec_001", "StorageUrl": "tos://bucket/recordings/rec_001.mp4" } } ``` ``` -------------------------------- ### Start Recording using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Initiates screen recording for a pod instance with specified format, bitrate, frame rate, and resolution. It returns a recording ID and storage URL upon successful initiation. ```php setPodId("pod_abc123") ->setRecordingFormat("mp4") ->setBitrate(2000000) ->setFrameRate(30) ->setResolution("1080p"); $response = $acepApi->startRecording($request); echo "Recording started\n"; echo "Recording ID: " . $response->getResult()->getRecordingId() . "\n"; echo "Storage URL: " . $response->getResult()->getStorageUrl() . "\n"; } catch (Exception $e) { echo "Failed to start recording: " . $e->getMessage() . "\n"; } // Expected output: // Recording started // Recording ID: rec_001 // Storage URL: tos://bucket/recordings/rec_001.mp4 ``` -------------------------------- ### List Available Apps using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves a list of available applications that can be installed on pods. Filters can be applied using product ID, app name, and app type. Outputs details for each app including name, ID, package name, latest version, and size. ```php setProductId("prod_12345") ->setMaxResults(50) ->setAppName("Game") ->setAppType(1); $response = $acepApi->listApp($request); foreach ($response->getResult()->getRow() as $app) { echo "App: " . $app->getAppName() . "\n"; echo "App ID: " . $app->getAppId() . "\n"; echo "Package: " . $app->getPackageName() . "\n"; echo "Latest Version: " . $app->getLatestVersion()->getVersionCode() . "\n"; echo "Size: " . $app->getLatestVersion()->getApkSize() . " MB\n"; echo "---\n"; } } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Expected output: // App: Mobile Game Pro // App ID: app_game_001 // Package: com.example.game // Latest Version: 1.5.2 // Size: 250 MB // --- ?> ``` -------------------------------- ### Get Data Center Bandwidth Peak using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves daily peak bandwidth statistics for a specified data center. Requires product ID, data center identifier, and a time range (start and end dates). Outputs date, peak upload/download speeds, and the time of the peak. ```php setProductId("prod_12345") ->setDc("cn-beijing-a") ->setStartTime("2025-01-01") ->setEndTime("2025-01-31"); $response = $acepApi->getDcBandwidthDailyPeak($request); foreach ($response->getResult()->getData() as $data) { echo "Date: " . $data->getDate() . "\n"; echo "Peak Upload: " . $data->getUploadPeak() . " Mbps\n"; echo "Peak Download: " . $data->getDownloadPeak() . " Mbps\n"; echo "Time: " . $data->getPeakTime() . "\n"; echo "---\n"; } } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Expected output: // Date: 2025-01-01 // Peak Upload: 1250 Mbps // Peak Download: 2800 Mbps // Time: 14:30:00 // --- ?> ``` -------------------------------- ### GET /api/acep/listPod Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves a list of cloud pods with filtering options for status, region, configuration, and pagination support. ```APIDOC ## GET /api/acep/listPod ### Description Retrieves a list of cloud pods with filtering options for status, region, configuration, and pagination support. ### Method GET ### Endpoint /api/acep/listPod ### Parameters #### Path Parameters None #### Query Parameters - **productId** (string) - Required - The product ID. - **maxResults** (integer) - Optional - The maximum number of results to return. - **nextToken** (string) - Optional - The token for pagination. - **podName** (string) - Optional - Filters by pod name. - **onlineList** (array) - Optional - Filters by online status. - **dcList** (array) - Optional - Filters by data center. - **configurationCodeList** (array) - Optional - Filters by configuration code. - **tagIdList** (array) - Optional - Filters by tag ID. - **archiveStatus** (integer) - Optional - Filters by archive status. - **authorityStatus** (integer) - Optional - Filters by authority status. ### Request Example ```json { "productId": "prod_12345", "maxResults": 50, "nextToken": "", "podName": "my-android", "onlineList": [1], "dcList": ["cn-beijing-a", "cn-beijing-b"], "configurationCodeList": ["android_config_001"], "tagIdList": ["tag_production"], "archiveStatus": 0, "authorityStatus": 1 } ``` ### Response #### Success Response (200) - **result** (object) - The result of the operation. - **totalCount** (integer) - The total number of pods. - **row** (array) - A list of pods. - **podId** (string) - The ID of the pod. - **podName** (string) - The name of the pod. - **online** (integer) - The online status of the pod. - **dc** (string) - The data center of the pod. - **nextToken** (string) - The token for pagination. #### Response Example ```json { "result": { "totalCount": 25, "row": [ { "podId": "pod_abc123", "podName": "my-android-pod-01", "online": 1, "dc": "cn-beijing-a" } ], "nextToken": "token_xyz789" } } ``` ``` -------------------------------- ### Get Phone Template Details using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves detailed information for a specific phone template identified by its template ID. The function outputs details such as template name, brand, model, Android version, screen specifications, RAM, and storage. Any errors encountered during the retrieval process are caught and displayed. ```php setTemplateId("template_samsung_s21"); $response = $acepApi->getPhoneTemplate($request); $template = $response->getResult(); echo "Template Details:\n"; echo "Name: " . $template->getTemplateName() . "\n"; echo "Brand: " . $template->getBrand() . "\n"; echo "Model: " . $template->getModel() . "\n"; echo "Android Version: " . $template->getAndroidVersion() . "\n"; echo "Screen: " . $template->getScreenWidth() . "x" . $template->getScreenHeight() . " @ " . $template->getDpi() . " DPI\n"; echo "RAM: " . ($template->getMemory() / 1024) . " GB\n"; echo "Storage: " . ($template->getStorage() / 1024) . " GB\n"; } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Expected output: // Template Details: // Name: Samsung-Galaxy-S21 // Brand: Samsung // Model: SM-G991B // Android Version: 12 // Screen: 1080x2400 @ 420 DPI // RAM: 8 GB // Storage: 125 GB ``` -------------------------------- ### API Configuration and Initialization Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt This section explains how to configure the Volcengine PHP SDK with authentication credentials (Access Key and Secret Key) and regional endpoint settings. It also shows how to initialize the ACEP API client. ```APIDOC ## API Configuration and Initialization ### Configure SDK with Authentication Sets up the SDK configuration with authentication credentials and regional endpoint settings for accessing Volcengine services. ```php setAk("YOUR_ACCESS_KEY") ->setSk("YOUR_SECRET_KEY") ->setRegion("cn-beijing"); // Configuration with custom endpoint $configWithHost = Configuration::getDefaultConfiguration() ->setAk("YOUR_ACCESS_KEY") ->setSk("YOUR_SECRET_KEY") ->setRegion("cn-beijing") ->setHost("acep.cn-beijing.volcengineapi.com"); // Initialize API client $acepApi = new ACEPApi( new Client(), $config ); // Expected: ACEPApi instance ready for API calls ``` ### Method GET, POST, PUT, DELETE, etc. ### Endpoint /api/configuration ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful configuration. #### Response Example ```json { "message": "Configuration successful" } ``` ``` -------------------------------- ### POST /api/acep/createPod Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Creates a new cloud pod (Android instance) with specified configuration including template, resource type, and network settings. ```APIDOC ## POST /api/acep/createPod ### Description Creates a new cloud pod (Android instance) with specified configuration including template, resource type, and network settings. ### Method POST ### Endpoint /api/acep/createPod ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **productId** (string) - Required - The product ID for the pod. - **podName** (string) - Optional - The name of the pod. - **configurationCode** (string) - Required - The configuration code for the pod. - **phoneTemplateId** (string) - Required - The ID of the phone template. - **imageId** (string) - Required - The ID of the image. - **dc** (string) - Required - The data center for the pod. - **resourceType** (integer) - Required - The resource type. - **start** (boolean) - Optional - Whether to start the pod after creation. - **upBandwidthLimit** (integer) - Optional - The upload bandwidth limit. - **downBandwidthLimit** (integer) - Optional - The download bandwidth limit. - **ipWhiteList** (string) - Optional - The IP white list. - **podSpecList** (array) - Required - A list of pod specifications. - **count** (integer) - Required - The number of pods. - **spec_type** (string) - Required - The type of specification. ### Request Example ```json { "productId": "prod_12345", "podName": "my-android-pod", "configurationCode": "android_config_001", "phoneTemplateId": "template_001", "imageId": "img_android_11", "dc": "cn-beijing-a", "resourceType": 1, "start": true, "upBandwidthLimit": 10240, "downBandwidthLimit": 20480, "ipWhiteList": "192.168.1.0/24,10.0.0.0/8", "podSpecList": [ { "count": 1, "spec_type": "standard" } ] } ``` ### Response #### Success Response (200) - **result** (object) - The result of the operation. - **podId** (string) - The ID of the created pod. - **responseMetadata** (object) - Metadata about the response. - **requestId** (string) - The request ID. #### Response Example ```json { "result": { "podId": "pod_abc123xyz" }, "responseMetadata": { "requestId": "req_20250101123456" } } ``` ``` -------------------------------- ### List Backup Data with Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves a list of available backups for specified pods, with options for filtering and pagination. Requires product ID and a list of pod IDs. Supports filtering by backup status and limiting the number of results. Iterates through the response to display details of each backup found. ```php setProductId("prod_12345") ->setPodIdList(["pod_abc123", "pod_xyz789"]) ->setMaxResults(20) ->setBackupStatus(2); $response = $acepApi->listBackupData($request); foreach ($response->getResult()->getRow() as $backup) { echo "Backup ID: " . $backup->getBackupId() . "\n"; echo "Name: " . $backup->getBackupName() . "\n"; echo "Size: " . $backup->getBackupSize() . " MB\n"; echo "Created: " . $backup->getCreateTime() . "\n"; echo "Status: " . $backup->getBackupStatus() . "\n"; echo "---\n"; } } catch (Exception $e) { echo "Error listing backups: " . $e->getMessage() . "\n"; } // Expected output: // Backup ID: backup_001 // Name: daily-backup-2025-01-01 // Size: 512 MB // Created: 2025-01-01 08:00:00 // Status: 2 // --- ?> ``` -------------------------------- ### Configure Volcengine SDK with Authentication Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Sets up the Volcengine PHP SDK with authentication credentials (Access Key, Secret Key) and regional endpoint settings. It supports both basic configuration and custom host configuration. The SDK utilizes Guzzle HTTP client for communication. ```php setAk("YOUR_ACCESS_KEY") ->setSk("YOUR_SECRET_KEY") ->setRegion("cn-beijing"); // Configuration with custom endpoint $configWithHost = Configuration::getDefaultConfiguration() ->setAk("YOUR_ACCESS_KEY") ->setSk("YOUR_SECRET_KEY") ->setRegion("cn-beijing") ->setHost("acep.cn-beijing.volcengineapi.com"); // Initialize API client $acepApi = new ACEPApi( new Client(), $config ); // Expected: ACEPApi instance ready for API calls ``` -------------------------------- ### Device Profile Templates API Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt APIs for creating, listing, and retrieving device profile templates. ```APIDOC ## POST /api/AddPhoneTemplate ### Description Creates a device profile template with specific hardware and software configurations. ### Method POST ### Endpoint /api/AddPhoneTemplate ### Parameters #### Request Body - **productId** (string) - Required - The ID of the product. - **templateName** (string) - Required - The name of the template. - **brand** (string) - Required - The brand of the device. - **model** (string) - Required - The model of the device. - **androidVersion** (string) - Required - The Android version. - **screenWidth** (integer) - Required - The screen width in pixels. - **screenHeight** (integer) - Required - The screen height in pixels. - **dpi** (integer) - Required - The screen density. - **memory** (integer) - Required - The device memory in MB. - **storage** (integer) - Required - The device storage in MB. ### Request Example ```json { "productId": "prod_12345", "templateName": "Samsung-Galaxy-S21", "brand": "Samsung", "model": "SM-G991B", "androidVersion": "12", "screenWidth": 1080, "screenHeight": 2400, "dpi": 420, "memory": 8192, "storage": 128000 } ``` ### Response #### Success Response (200) - **templateId** (string) - The ID of the created template. #### Response Example ```json { "result": { "templateId": "template_samsung_s21" } } ``` ``` ```APIDOC ## GET /api/ListPhoneTemplates ### Description Retrieves available device templates with filtering capabilities. ### Method GET ### Endpoint /api/ListPhoneTemplates ### Parameters #### Query Parameters - **productId** (string) - Required - The ID of the product. - **maxResults** (integer) - Optional - The maximum number of results to return. - **templateName** (string) - Optional - Filters templates by name. ### Response #### Success Response (200) - **row** (array) - An array of template objects. - **templateName** (string) - The name of the template. - **brand** (string) - The brand of the device. - **model** (string) - The model of the device. - **androidVersion** (string) - The Android version. - **screenWidth** (integer) - The screen width in pixels. - **screenHeight** (integer) - The screen height in pixels. #### Response Example ```json { "result": { "row": [ { "templateName": "Samsung-Galaxy-S21", "brand": "Samsung", "model": "SM-G991B", "androidVersion": "12", "screenWidth": 1080, "screenHeight": 2400 } ] } } ``` ``` ```APIDOC ## GET /api/GetPhoneTemplateDetails ### Description Retrieves detailed information about a specific phone template. ### Method GET ### Endpoint /api/GetPhoneTemplateDetails ### Parameters #### Query Parameters - **templateId** (string) - Required - The ID of the template. ### Response #### Success Response (200) - **templateName** (string) - The name of the template. - **brand** (string) - The brand of the device. - **model** (string) - The model of the device. - **androidVersion** (string) - The Android version. - **screenWidth** (integer) - The screen width in pixels. - **screenHeight** (integer) - The screen height in pixels. - **dpi** (integer) - The screen density. - **memory** (integer) - The device memory in MB. - **storage** (integer) - The device storage in MB. #### Response Example ```json { "result": { "templateName": "Samsung-Galaxy-S21", "brand": "Samsung", "model": "SM-G991B", "androidVersion": "12", "screenWidth": 1080, "screenHeight": 2400, "dpi": 420, "memory": 8192, "storage": 128000 } } ``` ``` -------------------------------- ### Backup Pod Data with Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Initiates a backup of pod data, including app state, configuration, and user data. Requires pod ID, backup name, and optionally a description and backup type. Returns a job ID and backup ID upon successful initiation. Includes error handling for backup failures. ```php setPodId("pod_abc123") ->setBackupName("daily-backup-2025-01-01") ->setDescription("Automated daily backup") ->setBackupType(1); $response = $acepApi->backupPod($request); echo "Backup initiated\n"; echo "Job ID: " . $response->getResult()->getJobId() . "\n"; echo "Backup ID: " . $response->getResult()->getBackupId() . "\n"; } catch (Exception $e) { echo "Backup failed: " . $e->getMessage() . "\n"; } // Expected output: // Backup initiated // Job ID: job_backup_001 // Backup ID: backup_20250101 ?> ``` -------------------------------- ### Migrate Pod Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Migrates a pod to a different data center or host. Provides target location details. ```APIDOC ## POST /api/pod/migrate ### Description Migrates a specified pod to a different data center or host. ### Method POST ### Endpoint /api/pod/migrate ### Parameters #### Request Body - **PodId** (string) - Required - The ID of the pod to migrate. - **TargetDc** (string) - Required - The ID of the target data center for migration. - **TargetHostId** (string) - Required - The ID of the target host for migration. ### Request Example ```json { "PodId": "pod_abc123", "TargetDc": "cn-shanghai-a", "TargetHostId": "host_shanghai_001" } ``` ### Response #### Success Response (200) - **Result** (object) - Contains the result of the migration operation. - **JobId** (string) - The ID of the asynchronous job created for the migration. - **EstimatedTime** (integer) - The estimated time in seconds for the migration to complete. #### Response Example ```json { "Result": { "JobId": "job_migrate_001", "EstimatedTime": 300 } } ``` ``` -------------------------------- ### Create Volcengine ACEP Cloud Pod Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Creates a new cloud pod (Android instance) using the Volcengine PHP SDK. It requires specifying product details, pod configuration, image, resource type, and network settings. Error handling is included for potential issues during creation. ```php setProductId("prod_12345") ->setPodName("my-android-pod") ->setConfigurationCode("android_config_001") ->setPhoneTemplateId("template_001") ->setImageId("img_android_11") ->setDc("cn-beijing-a") ->setResourceType(1) ->setStart(true) ->setUpBandwidthLimit(10240) ->setDownBandwidthLimit(20480) ->setIpWhiteList("192.168.1.0/24,10.0.0.0/8"); $podSpec = new PodSpecListForCreatePodInput([ 'count' => 1, 'spec_type' => 'standard' ]); $request->setPodSpecList([$podSpec]); $response = $acepApi->createPod($request); echo "Pod created successfully\n"; echo "Pod ID: " . $response->getResult()->getPodId() . "\n"; echo "Request ID: " . $response->getResponseMetadata()->getRequestId() . "\n"; } catch (Exception $e) { echo "Error creating pod: " . $e->getMessage() . "\n"; echo "Error code: " . $e->getCode() . "\n"; } // Expected output: // Pod created successfully // Pod ID: pod_abc123xyz // Request ID: req_20250101123456 ``` -------------------------------- ### Asynchronous API Calls with Promises using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Demonstrates how to perform asynchronous API calls using Guzzle promises for non-blocking operations. Multiple requests can be initiated concurrently and their results handled once available. This improves overall application responsiveness. ```php setProductId("prod_12345")->setMaxResults(50); $listBackupsRequest = new ListBackupDataRequest(); $listBackupsRequest->setProductId("prod_12345")->setMaxResults(20); // Execute async calls $podsPromise = $acepApi->listPodAsync($listPodsRequest); $backupsPromise = $acepApi->listBackupDataAsync($listBackupsRequest); // Handle results when ready $podsPromise->then( function ($podsResponse) { echo "Pods loaded: " . count($podsResponse->getResult()->getRow()) . "\n"; }, function ($error) { echo "Pods error: " . $error->getMessage() . "\n"; } ); $backupsPromise->then( function ($backupsResponse) { echo "Backups loaded: " . count($backupsResponse->getResult()->getRow()) . "\n"; }, function ($error) { echo "Backups error: " . $error->getMessage() . "\n"; } ); // Wait for all promises \GuzzleHttp\Promise\Utils::all([$podsPromise, $backupsPromise])->wait(); } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Expected output: // Pods loaded: 25 // Backups loaded: 8 ?> ``` -------------------------------- ### Add Phone Template using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Creates a device profile template with specific hardware and software configurations. It requires a product ID and template details like name, brand, model, Android version, screen dimensions, DPI, memory, and storage. Returns the created template ID upon success. ```php setProductId("prod_12345") ->setTemplateName("Samsung-Galaxy-S21") ->setBrand("Samsung") ->setModel("SM-G991B") ->setAndroidVersion("12") ->setScreenWidth(1080) ->setScreenHeight(2400) ->setDpi(420) ->setMemory(8192) ->setStorage(128000); $response = $acepApi->addPhoneTemplate($request); echo "Template created\n"; echo "Template ID: " . $response->getResult()->getTemplateId() . "\n"; } catch (Exception $e) { echo "Failed to create template: " . $e->getMessage() . "\n"; } // Expected output: // Template created // Template ID: template_samsung_s21 ``` -------------------------------- ### List Phone Templates using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves a list of available device templates, supporting filtering by product ID and template name, and limiting the number of results. It iterates through the returned templates, displaying their names, brands, models, Android versions, and screen resolutions. Errors during the process are caught and reported. ```php setProductId("prod_12345") ->setMaxResults(30) ->setTemplateName("Samsung"); $response = $acepApi->listPhoneTemplate($request); foreach ($response->getResult()->getRow() as $template) { echo "Template: " . $template->getTemplateName() . "\n"; echo "Brand: " . $template->getBrand() . " " . $template->getModel() . "\n"; echo "Android: " . $template->getAndroidVersion() . "\n"; echo "Resolution: " . $template->getScreenWidth() . "x" . $template->getScreenHeight() . "\n"; echo "---\n"; } } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Expected output: // Template: Samsung-Galaxy-S21 // Brand: Samsung SM-G991B // Android: 12 // Resolution: 1080x2400 // --- ``` -------------------------------- ### Restore Pod from Backup with Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Restores a pod to a previous state using a specified backup. Requires the pod ID and the backup ID to perform the restore operation. It also accepts a restore type parameter. The operation initiates a restore job and returns its ID. Error handling is included for failed restore attempts. ```php setPodId("pod_abc123") ->setBackupId("backup_20250101") ->setRestoreType(1); $response = $acepApi->restorePod($request); echo "Restore initiated\n"; echo "Job ID: " . $response->getResult()->getJobId() . "\n"; } catch (Exception $e) { echo "Restore failed: " . $e->getMessage() . "\n"; } // Expected output: // Restore initiated // Job ID: job_restore_001 ?> ``` -------------------------------- ### Migrate Pod using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Migrates a pod to a different data center or host. This operation requires the pod ID, target data center, and target host ID. It returns a job ID and estimated migration time. ```php setPodId("pod_abc123") ->setTargetDc("cn-shanghai-a") ->setTargetHostId("host_shanghai_001"); $response = $acepApi->migratePod($request); echo "Migration started\n"; echo "Job ID: " . $response->getResult()->getJobId() . "\n"; echo "Estimated time: " . $response->getResult()->getEstimatedTime() . " seconds\n"; } catch (Exception $e) { echo "Migration failed: " . $e->getMessage() . "\n"; } // Expected output: // Migration started // Job ID: job_migrate_001 // Estimated time: 300 seconds ``` -------------------------------- ### List Volcengine ACEP Cloud Pods Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Retrieves a list of cloud pods using the Volcengine PHP SDK. Supports filtering by product ID, pod name, status, region, and configuration. Includes pagination support with `maxResults` and `nextToken`. Error handling is provided. ```php setProductId("prod_12345") ->setMaxResults(50) ->setNextToken("") ->setPodName("my-android") ->setOnlineList([1]) ->setDcList(["cn-beijing-a", "cn-beijing-b"]) ->setConfigurationCodeList(["android_config_001"]) ->setTagIdList(["tag_production"]) ->setArchiveStatus(0) ->setAuthorityStatus(1); $response = $acepApi->listPod($request); $pods = $response->getResult()->getRow(); echo "Total pods: " . $response->getResult()->getTotalCount() . "\n"; foreach ($pods as $pod) { echo "Pod ID: " . $pod->getPodId() . "\n"; echo "Pod Name: " . $pod->getPodName() . "\n"; echo "Status: " . $pod->getOnline() . "\n"; echo "DC: " . $pod->getDc() . "\n"; echo "---\n"; } // Handle pagination if ($nextToken = $response->getResult()->getNextToken()) { echo "More results available, next token: " . $nextToken . "\n"; } } catch (Exception $e) { echo "Error listing pods: " . $e->getMessage() . "\n"; } // Expected output: // Total pods: 25 // Pod ID: pod_abc123 // Pod Name: my-android-pod-01 // Status: 1 // DC: cn-beijing-a // --- // More results available, next token: token_xyz789 ``` -------------------------------- ### List Custom Network Routes using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Lists configured custom network routes, allowing filtering by product ID and limiting the number of results. The function iterates through the returned routes, displaying their names, destination CIDRs, next hop types and IDs, and status. Any errors during the listing process are caught and reported. ```php setProductId("prod_12345") ->setMaxResults(50); $response = $acepApi->listCustomRoute($request); foreach ($response->getResult()->getRow() as $route) { echo "Route: " . $route->getRouteName() . "\n"; echo "Destination: " . $route->getDestinationCidr() . "\n"; echo "Next Hop: " . $route->getNextHopType() . " (" . $route->getNextHopId() . ")\n"; echo "Status: " . $route->getStatus() . "\n"; echo "---\n"; } } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Expected output: // Route: vpn-route-001 // Destination: 10.100.0.0/16 // Next Hop: VPN (vpn_gateway_001) // Status: active // --- ``` -------------------------------- ### Custom Network Routing API Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt APIs for configuring and listing custom network routing rules. ```APIDOC ## POST /api/AddCustomRoute ### Description Configures custom network routing rules for pod traffic. ### Method POST ### Endpoint /api/AddCustomRoute ### Parameters #### Request Body - **productId** (string) - Required - The ID of the product. - **routeName** (string) - Required - The name of the route. - **destinationCidr** (string) - Required - The destination CIDR block. - **nextHopType** (string) - Required - The type of the next hop (e.g., "VPN"). - **nextHopId** (string) - Required - The ID of the next hop. - **description** (string) - Optional - A description for the route. ### Request Example ```json { "productId": "prod_12345", "routeName": "vpn-route-001", "destinationCidr": "10.100.0.0/16", "nextHopType": "VPN", "nextHopId": "vpn_gateway_001", "description": "Route to internal VPN network" } ``` ### Response #### Success Response (200) - **routeId** (string) - The ID of the created route. #### Response Example ```json { "result": { "routeId": "route_vpn_001" } } ``` ``` ```APIDOC ## GET /api/ListCustomRoutes ### Description Lists configured custom routes with filtering options. ### Method GET ### Endpoint /api/ListCustomRoutes ### Parameters #### Query Parameters - **productId** (string) - Required - The ID of the product. - **maxResults** (integer) - Optional - The maximum number of results to return. ### Response #### Success Response (200) - **row** (array) - An array of route objects. - **routeName** (string) - The name of the route. - **destinationCidr** (string) - The destination CIDR block. - **nextHopType** (string) - The type of the next hop. - **nextHopId** (string) - The ID of the next hop. - **status** (string) - The status of the route. #### Response Example ```json { "result": { "row": [ { "routeName": "vpn-route-001", "destinationCidr": "10.100.0.0/16", "nextHopType": "VPN", "nextHopId": "vpn_gateway_001", "status": "active" } ] } } ``` ``` -------------------------------- ### Capture Screenshot using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Captures a screenshot from a pod's current screen state. Requires the pod ID, desired format (e.g., 'png'), and quality level. Returns an image URL upon successful capture. ```php setPodId("pod_abc123") ->setFormat("png") ->setQuality(90); $response = $acepApi->startScreenShot($request); echo "Screenshot captured\n"; echo "Image URL: " . $response->getResult()->getImageUrl() . "\n"; } catch (Exception $e) { echo "Screenshot failed: " . $e->getMessage() . "\n"; } // Expected output: // Screenshot captured // Image URL: https://cdn.example.com/screenshots/screen_001.png ?> ``` -------------------------------- ### Add Custom Network Route using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Configures custom network routing rules for pod traffic, specifying a product ID, route name, destination CIDR, next hop type, and next hop ID. It includes an optional description for the route. Upon successful creation, it outputs the new route ID. Errors are handled and reported. ```php setProductId("prod_12345") ->setRouteName("vpn-route-001") ->setDestinationCidr("10.100.0.0/16") ->setNextHopType("VPN") ->setNextHopId("vpn_gateway_001") ->setDescription("Route to internal VPN network"); $response = $acepApi->addCustomRoute($request); echo "Route created\n"; echo "Route ID: " . $response->getResult()->getRouteId() . "\n"; } catch (Exception $e) { echo "Failed to add route: " . $e->getMessage() . "\n"; } // Expected output: // Route created // Route ID: route_vpn_001 ``` -------------------------------- ### Reset Pod using Volcengine PHP SDK Source: https://context7.com/volcengine/volcengine-php-sdk/llms.txt Resets a pod to its initial state, clearing data and configurations. It accepts a list of pod IDs and a reset type. The output includes job details for each pod reset. ```php setPodIdList(["pod_abc123", "pod_xyz789"]) ->setResetType(1); $response = $acepApi->resetPod($request); foreach ($response->getResult()->getJob() as $job) { echo "Pod ID: " . $job->getPodId() . "\n"; echo "Job ID: " . $job->getJobId() . "\n"; echo "Status: " . $job->getStatus() . "\n"; } } catch (Exception $e) { echo "Reset failed: " . $e->getMessage() . "\n"; } // Expected output: // Pod ID: pod_abc123 // Job ID: job_reset_001 // Status: running ```