|
| 1 | +package client |
| 2 | + |
| 3 | +import ( |
| 4 | + clientv1 "github.com/spectrocloud/palette-sdk-go/api/client/v1" |
| 5 | + "github.com/spectrocloud/palette-sdk-go/api/models" |
| 6 | +) |
| 7 | + |
| 8 | +// UpdateSessionTimeout update session timout for platform |
| 9 | +func (h *V1Client) UpdateSessionTimeout(tenantUID string, body *models.V1AuthTokenSettings) error { |
| 10 | + params := clientv1.NewV1TenantUIDAuthTokenSettingsUpdateParamsWithContext(h.ctx).WithTenantUID(tenantUID).WithBody(body) |
| 11 | + _, err := h.Client.V1TenantUIDAuthTokenSettingsUpdate(params) |
| 12 | + return err |
| 13 | +} |
| 14 | + |
| 15 | +// GetSessionTimeout get session timout for platform |
| 16 | +func (h *V1Client) GetSessionTimeout(tenantUID string) (*models.V1AuthTokenSettings, error) { |
| 17 | + params := clientv1.NewV1TenantUIDAuthTokenSettingsGetParamsWithContext(h.ctx).WithTenantUID(tenantUID) |
| 18 | + resp, err := h.Client.V1TenantUIDAuthTokenSettingsGet(params) |
| 19 | + return resp.Payload, err |
| 20 | +} |
| 21 | + |
| 22 | +// UpdatePlatformClusterUpgradeSetting update clusters agent upgrade setting for tenant |
| 23 | +func (h *V1Client) UpdatePlatformClusterUpgradeSetting(body *models.V1ClusterUpgradeSettingsEntity) error { |
| 24 | + params := clientv1.NewV1SpectroClustersUpgradeSettingsParamsWithContext(h.ctx).WithBody(body) |
| 25 | + _, err := h.Client.V1SpectroClustersUpgradeSettings(params) |
| 26 | + return err |
| 27 | +} |
| 28 | + |
| 29 | +// GetPlatformClustersUpgradeSetting get clusters agent upgrade setting for tenant |
| 30 | +func (h *V1Client) GetPlatformClustersUpgradeSetting() (*models.V1ClusterUpgradeSettingsEntity, error) { |
| 31 | + params := clientv1.NewV1SpectroClustersUpgradeSettingsGetParamsWithContext(h.ctx) |
| 32 | + resp, err := h.Client.V1SpectroClustersUpgradeSettingsGet(params) |
| 33 | + return resp.Payload, err |
| 34 | +} |
| 35 | + |
| 36 | +// UpdateClusterAutoRemediationForTenant update cluster auto remediation for platform |
| 37 | +func (h *V1Client) UpdateClusterAutoRemediationForTenant(tenantUID string, body *models.V1NodesAutoRemediationSettings) error { |
| 38 | + params := clientv1.NewV1TenantClustersNodesAutoRemediationSettingUpdateParamsWithContext(h.ctx). |
| 39 | + WithTenantUID(tenantUID).WithBody(body) |
| 40 | + _, err := h.Client.V1TenantClustersNodesAutoRemediationSettingUpdate(params) |
| 41 | + return err |
| 42 | +} |
| 43 | + |
| 44 | +// GetClusterAutoRemediationForTenant get cluster auto remediation for platform |
| 45 | +func (h *V1Client) GetClusterAutoRemediationForTenant(tenantUID string) (*models.V1TenantClusterSettings, error) { |
| 46 | + params := clientv1.NewV1TenantClusterSettingsGetParamsWithContext(h.ctx).WithTenantUID(tenantUID) |
| 47 | + resp, err := h.Client.V1TenantClusterSettingsGet(params) |
| 48 | + return resp.Payload, err |
| 49 | +} |
| 50 | + |
| 51 | +// UpdateClusterAutoRemediationForProject update cluster auto remediation for project |
| 52 | +func (h *V1Client) UpdateClusterAutoRemediationForProject(projectUID string, body *models.V1NodesAutoRemediationSettings) error { |
| 53 | + params := clientv1.NewV1ProjectClustersNodesAutoRemediationSettingUpdateParamsWithContext(h.ctx). |
| 54 | + WithUID(projectUID).WithBody(body) |
| 55 | + _, err := h.Client.V1ProjectClustersNodesAutoRemediationSettingUpdate(params) |
| 56 | + return err |
| 57 | +} |
| 58 | + |
| 59 | +// GetClusterAutoRemediationForProject get cluster auto remediation for project |
| 60 | +func (h *V1Client) GetClusterAutoRemediationForProject(projectUID string) (*models.V1ProjectClusterSettings, error) { |
| 61 | + params := clientv1.NewV1ProjectClusterSettingsGetParamsWithContext(h.ctx).WithUID(projectUID) |
| 62 | + resp, err := h.Client.V1ProjectClusterSettingsGet(params) |
| 63 | + return resp.Payload, err |
| 64 | +} |
| 65 | + |
| 66 | +// UpdateLoginBanner update login banner details for platform |
| 67 | +func (h *V1Client) UpdateLoginBanner(tenantUID string, body *models.V1LoginBannerSettings) error { |
| 68 | + params := clientv1.NewV1TenantUIDLoginBannerUpdateParamsWithContext(h.ctx).WithTenantUID(tenantUID).WithBody(body) |
| 69 | + _, err := h.Client.V1TenantUIDLoginBannerUpdate(params) |
| 70 | + return err |
| 71 | +} |
| 72 | + |
| 73 | +// GetLoginBanner get login banner details for platform |
| 74 | +func (h *V1Client) GetLoginBanner(tenantUID string) (*models.V1LoginBannerSettings, error) { |
| 75 | + params := clientv1.NewV1TenantUIDLoginBannerGetParamsWithContext(h.ctx).WithTenantUID(tenantUID) |
| 76 | + resp, err := h.Client.V1TenantUIDLoginBannerGet(params) |
| 77 | + return resp.Payload, err |
| 78 | +} |
| 79 | + |
| 80 | +// UpdateFIPSPreference update fips preference for platform |
| 81 | +func (h *V1Client) UpdateFIPSPreference(tenantUID string, body *models.V1FipsSettings) error { |
| 82 | + params := clientv1.NewV1TenantFipsSettingsUpdateParamsWithContext(h.ctx).WithTenantUID(tenantUID).WithBody(body) |
| 83 | + _, err := h.Client.V1TenantFipsSettingsUpdate(params) |
| 84 | + return err |
| 85 | +} |
| 86 | + |
| 87 | +// GetFIPSPreference get fips preference for platform |
| 88 | +func (h *V1Client) GetFIPSPreference(tenantUID string) (*models.V1FipsSettings, error) { |
| 89 | + params := clientv1.NewV1TenantFipsSettingsGetParamsWithContext(h.ctx).WithTenantUID(tenantUID) |
| 90 | + resp, err := h.Client.V1TenantFipsSettingsGet(params) |
| 91 | + return resp.Payload, err |
| 92 | +} |
0 commit comments