我试图通过REST API创建一台机器,通过PowerShell调用它。通过REST API创建Octopus机器(PowerShell)
根据documentation,只需要机器的名称和指纹来创建机器。但是,一切都我尝试导致无论是405还是500错误:
$newMachine = @{Name='machineName';Thumbprint='asdvblsafghkvadc';} | ConvertTo-Json
$webClient.UploadString('http://server/octopus/api/machines','POST',$newMachine)
### OR
$newMachine = @{Name='machineName';Thumbprint='asdvblsafghkvadc';Roles='[web-server]';EnvironmentIds='[Environment-12]'; | ConvertTo-Json
$webClient.UploadString('http://server/octopus/api/machines','POST',$newMachine)
创建环境和编辑机很好地工作,我不能让这台机器创造了下来。
感谢您发布答案。我*认为*这些库包含在您的代码段中。我的错。 – osij2is