зеркало из https://github.com/microsoft/BCTech.git
add get environment operations
This commit is contained in:
Родитель
f091542328
Коммит
495de98e92
|
@ -77,4 +77,16 @@ class Environments
|
||||||
SupportContact supportContact = adminCenterClient.GetSupportContactInformation("BusinessCentral", environmentName);
|
SupportContact supportContact = adminCenterClient.GetSupportContactInformation("BusinessCentral", environmentName);
|
||||||
Utils.ConsoleWriteLineAsJson(supportContact);
|
Utils.ConsoleWriteLineAsJson(supportContact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void GetEnvironmentOperations(AdminCenterClient adminCenterClient, string environmentName)
|
||||||
|
{
|
||||||
|
Microsoft.Dynamics.BusinessCentral.AdminCenter.Models.EnvironmentOperationListResult operations = adminCenterClient.GetOperations("BusinessCentral", environmentName);
|
||||||
|
Utils.ConsoleWriteLineAsJson(operations);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void GetOperationsForAllEnvironments(AdminCenterClient adminCenterClient)
|
||||||
|
{
|
||||||
|
Microsoft.Dynamics.BusinessCentral.AdminCenter.Models.EnvironmentOperationListResult operations = adminCenterClient.GetOperationsForAllEnvironments();
|
||||||
|
Utils.ConsoleWriteLineAsJson(operations);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -15,7 +15,7 @@ namespace CSharp
|
||||||
{
|
{
|
||||||
ClientId = "a19cb26a-2e4c-408b-82e1-6311742ecc50", // partner's AAD app id
|
ClientId = "a19cb26a-2e4c-408b-82e1-6311742ecc50", // partner's AAD app id
|
||||||
RedirectUri = new Uri("http://localhost"), // partner's AAD app redirect URI
|
RedirectUri = new Uri("http://localhost"), // partner's AAD app redirect URI
|
||||||
TenantId = "f5b6b245-5dd2-4bf5-94d4-35ef04d73c6d", // customer's tenant id
|
TenantId = "62eebfa1-8379-45eb-afc4-ad28abdeabfe", // customer's tenant id
|
||||||
};
|
};
|
||||||
var tokenCredential = new InteractiveBrowserCredential(interactiveBrowserCredentialOptions);
|
var tokenCredential = new InteractiveBrowserCredential(interactiveBrowserCredentialOptions);
|
||||||
|
|
||||||
|
@ -25,29 +25,34 @@ namespace CSharp
|
||||||
// Manage environments
|
// Manage environments
|
||||||
Environments.ListEnvironments(adminCenterClient);
|
Environments.ListEnvironments(adminCenterClient);
|
||||||
Environments.CreateNewEnvironment(adminCenterClient, "MySandbox", "Sandbox", "DK");
|
Environments.CreateNewEnvironment(adminCenterClient, "MySandbox", "Sandbox", "DK");
|
||||||
Environments.CopyProductionEnvironmentToSandboxEnvironment(adminCenterClient, "MyProd", "MySandboxAsACopy");
|
Environments.CopyProductionEnvironmentToSandboxEnvironment(adminCenterClient, "Production", "MySandboxAsACopy");
|
||||||
Environments.SetAppInsightsKey(adminCenterClient, "MyProd", new Guid("0da21b54-841e-4a64-a117-6092784245f9"));
|
Environments.SetAppInsightsKey(adminCenterClient, "Production", new Guid("0da21b54-841e-4a64-a117-6092784245f9"));
|
||||||
Environments.GetDatabaseSize(adminCenterClient, "MyProd");
|
Environments.GetDatabaseSize(adminCenterClient, "Production");
|
||||||
Environments.GetSupportSettings(adminCenterClient, "MyProd");
|
Environments.GetSupportSettings(adminCenterClient, "Production");
|
||||||
|
Environments.RenameEnvironment(adminCenterClient, "MySandbox", "MySandboxRenamed");
|
||||||
|
Environments.RestartEnvironment(adminCenterClient, "Production");
|
||||||
|
Environments.RemoveEnvironment(adminCenterClient, "MySandboxRenamed");
|
||||||
|
Environments.GetEnvironmentOperations(adminCenterClient, "Production");
|
||||||
|
Environments.GetOperationsForAllEnvironments(adminCenterClient);
|
||||||
|
|
||||||
// Manage support settings
|
// Manage support settings
|
||||||
NotificationRecipients.GetNotificationRecipients(adminCenterClient);
|
NotificationRecipients.GetNotificationRecipients(adminCenterClient);
|
||||||
NotificationRecipients.AddNotificationRecipient(adminCenterClient, "partnernotifications@partnerdomain.com", "Partner Notifications Mail Group");
|
NotificationRecipients.AddNotificationRecipient(adminCenterClient, "partnernotifications@partnerdomain.com", "Partner Notifications Mail Group");
|
||||||
|
|
||||||
// Manage apps
|
// Manage apps
|
||||||
Apps.GetInstalledApps(adminCenterClient, "MyProd");
|
Apps.GetInstalledApps(adminCenterClient, "Production");
|
||||||
Apps.GetAvailableAppUpdates(adminCenterClient, "MyProd");
|
Apps.GetAvailableAppUpdates(adminCenterClient, "Production");
|
||||||
Apps.UpdateApp(adminCenterClient, "MyProd", new Guid("334ef79e-547e-4631-8ba1-7a7f18e14de6"), "16.0.11240.12188");
|
Apps.UpdateApp(adminCenterClient, "Production", new Guid("334ef79e-547e-4631-8ba1-7a7f18e14de6"), "16.0.11240.12188");
|
||||||
Apps.GetAppOperations(adminCenterClient, "MyProd", new Guid("334ef79e-547e-4631-8ba1-7a7f18e14de6"));
|
Apps.GetAppOperations(adminCenterClient, "Production", new Guid("334ef79e-547e-4631-8ba1-7a7f18e14de6"));
|
||||||
|
|
||||||
// Manage active sessions
|
// Manage active sessions
|
||||||
Sessions.GetActiveSessions(adminCenterClient, "MyProd");
|
Sessions.GetActiveSessions(adminCenterClient, "Production");
|
||||||
Sessions.CancelSession(adminCenterClient, "MyProd", 196719);
|
Sessions.CancelSession(adminCenterClient, "Production", 196719);
|
||||||
|
|
||||||
// Manage update settings
|
// Manage update settings
|
||||||
UpdateSettings.GetUpdateWindow(adminCenterClient, "MyProd");
|
UpdateSettings.GetUpdateWindow(adminCenterClient, "Production");
|
||||||
UpdateSettings.SetUpdateWindow(adminCenterClient, "MyProd", new DateTime(2020, 06, 01, 4, 15, 0), new DateTime(2020, 06, 01, 11, 30, 0));
|
UpdateSettings.SetUpdateWindow(adminCenterClient, "Production", new DateTime(2020, 06, 01, 4, 15, 0), new DateTime(2020, 06, 01, 11, 30, 0));
|
||||||
UpdateSettings.GetScheduledUpdates(adminCenterClient, "MyProd");
|
UpdateSettings.GetScheduledUpdates(adminCenterClient, "Production");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче