Skip to content

Commit a2031fd

Browse files
raltclaude
andauthored
Support parameters for runtime operations (#101)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a4a9424 commit a2031fd

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/Model/Deployment/EnvironmentDeployment.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,23 @@ public function getRuntimeOperations(): array
100100
* The operation name.
101101
* @param string $service
102102
* The name of the service or application to run the operation on.
103+
* @param array<string, string> $parameters
104+
* Parameters to pass to the operation, as key-value pairs.
103105
*
104106
*@see RuntimeOperation
105107
* @see AppBase::getRuntimeOperations()
106108
* @see AppBase::getRuntimeOperation()
107109
*/
108-
public function execRuntimeOperation(string $name, string $service): \Platformsh\Client\Model\Result
110+
public function execRuntimeOperation(string $name, string $service, array $parameters = []): \Platformsh\Client\Model\Result
109111
{
110-
return $this->runOperation('operations', 'post', [
112+
$body = [
111113
'operation' => $name,
112114
'service' => $service,
113-
]);
115+
];
116+
if ($parameters) {
117+
$body['parameters'] = (object) $parameters;
118+
}
119+
120+
return $this->runOperation('operations', 'post', $body);
114121
}
115122
}

0 commit comments

Comments
 (0)