Skip to content

Commit 2928395

Browse files
Updated doco for changes to Client contracts (#2746)
* Updated doco for OctopusDeploy/OctopusClients#936 * Make the spell checker happy * Modified date change * Update managing-configuration.md --------- Co-authored-by: Steve Fenton <99181436+steve-fenton-octopus@users.noreply.github.com>
1 parent 78b16e5 commit 2928395

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

src/pages/docs/administration/managing-infrastructure/server-configuration/managing-configuration.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: src/layouts/Default.astro
33
pubDate: 2023-01-01
4-
modDate: 2023-01-01
4+
modDate: 2025-06-10
55
title: Managing server configuration
66
description: The Octopus Server configuration can be managed programmatically through the Octopus.Client library and the API
77
navOrder: 1801
@@ -22,19 +22,8 @@ In the Octopus Web Portal, you can access configuration by navigating to **Confi
2222

2323
Using [Octopus.Client](/docs/octopus-rest-api/octopus.client), each of the configuration types can be managed programmatically, reading from and writing back to the Octopus Deploy database.
2424

25-
The class definitions for each of the configurations is available by referencing the relevant `Octopus.Client.Extensibility.*` library, which are available via NuGet:
26-
27-
- [Octopus.Client.Extensibility.Authentication.Guest](https://www.nuget.org/packages/Octopus.Client.Extensibility.Authentication.Guest/)
28-
- [Octopus.Client.Extensibility.Authentication.DirectoryServices](https://www.nuget.org/packages/Octopus.Client.Extensibility.Authentication.DirectoryServices/)
29-
- [Octopus.Client.Extensibility.Authentication.UsernamePassword](https://www.nuget.org/packages/Octopus.Client.Extensibility.Authentication.UsernamePassword/)
30-
- [Octopus.Client.Extensibility.Authentication.AzureAD](https://www.nuget.org/packages/Octopus.Client.Extensibility.Authentication.AzureAD/)
31-
- [Octopus.Client.Extensibility.Authentication.GoogleApps](https://www.nuget.org/packages/Octopus.Client.Extensibility.Authentication.GoogleApps/)
32-
- [Octopus.Client.Extensibility.Authentication.Okta](https://www.nuget.org/packages/Octopus.Client.Extensibility.Authentication.Okta/)
33-
34-
Web Portal and Authentication types are available in [Octopus.Client](https://www.nuget.org/packages/Octopus.Client/)
35-
3625
:::div{.hint}
37-
This requires version 4.27.0 or later of the client library.
26+
This requires version 15.2.0 or later of the client library.
3827
:::
3928

4029
### .Net / C#
@@ -58,22 +47,21 @@ var server = "http://myoctopusserver/";
5847
var apiKey = "API-XXXXXXXX"; // Get this from your 'profile' page in the Octopus Web Portal
5948
var endpoint = new OctopusServerEndpoint(server, apiKey);
6049
var repository = new OctopusRepository(endpoint);
61-
var webportalConfig = repository.Configuration.Get<WebPortalConfigResource>();
62-
webportalConfig.Security.HttpStrictTransportSecurityEnabled = true;
63-
webportalConfig = repository.Configuration.Modify(webportalConfig);
50+
var webPortalConfig = repository.Configuration.Get<WebPortalConfigResource>();
51+
webPortalConfig.Security.HttpStrictTransportSecurityEnabled = true;
52+
webPortalConfig = repository.Configuration.Modify(webPortalConfig);
6453
```
6554

6655
### PowerShell
6756

6857
```powershell
6958
add-type -path 'C:\PathTo\Octopus.Client.dll'
70-
add-type -path 'C:\PathTo\Octopus.Client.Extensibility.Authentication.Guest.dll'
7159
$server = 'http://myoctopusserver/'
7260
$apikey = 'API-XXXXXXXX';
7361
$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $server,$apikey
7462
$repo = New-Object Octopus.Client.OctopusRepository $endpoint
75-
$getMethod = $repo.Configuration.GetType().GetMethod("Get").MakeGenericMethod([Octopus.Client.Extensibility.Authentication.Guest.Configuration.GuestConfigurationResource])
76-
$modifyMethod = $repo.Configuration.GetType().GetMethod("Modify").MakeGenericMethod([Octopus.Client.Extensibility.Authentication.Guest.Configuration.GuestConfigurationResource])
63+
$getMethod = $repo.Configuration.GetType().GetMethod("Get").MakeGenericMethod([Octopus.Client.Model.Authentication.Guest.GuestConfigurationResource])
64+
$modifyMethod = $repo.Configuration.GetType().GetMethod("Modify").MakeGenericMethod([Octopus.Client.Model.Authentication.Guest.GuestConfigurationResource])
7765
$guestConfig = $getMethod.Invoke($repo.Configuration, $null)
7866
$guestConfig.IsEnabled = $true;
7967
$guestConfig = $modifyMethod.Invoke($repo.Configuration, $guestConfig)

0 commit comments

Comments
 (0)