Documentation
¶
Index ¶
- Variables
- type MockInventoryServiceClient
- func (m *MockInventoryServiceClient) Close() error
- func (m *MockInventoryServiceClient) Create(ctx context.Context, in *inventory.Resource) (*inventory.Resource, error)
- func (m *MockInventoryServiceClient) Delete(ctx context.Context, in string) (*inventory.DeleteResourceResponse, error)
- func (m *MockInventoryServiceClient) DeleteAllResources(ctx context.Context, in string, kind inventory.ResourceKind) error
- func (m *MockInventoryServiceClient) Find(ctx context.Context, in *inventory.ResourceFilter) (*inventory.FindResourcesResponse, error)
- func (m *MockInventoryServiceClient) FindAll(ctx context.Context, filter *inventory.ResourceFilter) ([]*inventory.FindResourcesResponse_ResourceTenantIDCarrier, error)
- func (m *MockInventoryServiceClient) Get(ctx context.Context, in string) (*inventory.GetResourceResponse, error)
- func (m *MockInventoryServiceClient) GetHostByUUID(ctx context.Context, uuid string) (*computev1.HostResource, error)
- func (m *MockInventoryServiceClient) GetSitesPerRegion(ctx context.Context, getReq *inventory.GetSitesPerRegionRequest) (*inventory.GetSitesPerRegionResponse, error)
- func (m *MockInventoryServiceClient) GetTenantAwareInventoryClient() client.TenantAwareInventoryClient
- func (m *MockInventoryServiceClient) GetTreeHierarchy(ctx context.Context, getTreeReq *inventory.GetTreeHierarchyRequest) ([]*inventory.GetTreeHierarchyResponse_TreeNode, error)
- func (m *MockInventoryServiceClient) List(ctx context.Context, in *inventory.ResourceFilter) (*inventory.ListResourcesResponse, error)
- func (m *MockInventoryServiceClient) ListAll(ctx context.Context, filter *inventory.ResourceFilter) ([]*inventory.Resource, error)
- func (m *MockInventoryServiceClient) ListInheritedTelemetryProfiles(ctx context.Context, ...) (*inventory.ListInheritedTelemetryProfilesResponse, error)
- func (m *MockInventoryServiceClient) TestGetClientCache() *cache.InventoryCache
- func (m *MockInventoryServiceClient) TestGetClientCacheUUID() *cache.InventoryCache
- func (m *MockInventoryServiceClient) TestingOnlySetClient(c inventory.InventoryServiceClient)
- func (m *MockInventoryServiceClient) Update(ctx context.Context, resID string, fm *fieldmaskpb.FieldMask, ...) (*inventory.Resource, error)
- func (m *MockInventoryServiceClient) UpdateSubscriptions(ctx context.Context, in []inventory.ResourceKind) error
- type MockInventoryServiceClientError
- func (m *MockInventoryServiceClientError) Close() error
- func (m *MockInventoryServiceClientError) Create(ctx context.Context, in *inventory.Resource) (*inventory.Resource, error)
- func (m *MockInventoryServiceClientError) Delete(ctx context.Context, in string) (*inventory.DeleteResourceResponse, error)
- func (m *MockInventoryServiceClientError) DeleteAllResources(ctx context.Context, in string, kind inventory.ResourceKind, _ bool) error
- func (m *MockInventoryServiceClientError) Find(ctx context.Context, in *inventory.ResourceFilter) (*inventory.FindResourcesResponse, error)
- func (m *MockInventoryServiceClientError) FindAll(ctx context.Context, filter *inventory.ResourceFilter) ([]*inventory.FindResourcesResponse_ResourceTenantIDCarrier, error)
- func (m *MockInventoryServiceClientError) Get(ctx context.Context, in string) (*inventory.GetResourceResponse, error)
- func (m *MockInventoryServiceClientError) GetHostByUUID(ctx context.Context, uuid string) (*computev1.HostResource, error)
- func (m *MockInventoryServiceClientError) GetSitesPerRegion(ctx context.Context, getReq *inventory.GetSitesPerRegionRequest) (*inventory.GetSitesPerRegionResponse, error)
- func (m *MockInventoryServiceClientError) GetTenantAwareInventoryClient() client.TenantAwareInventoryClient
- func (m *MockInventoryServiceClientError) GetTreeHierarchy(ctx context.Context, getTreeReq *inventory.GetTreeHierarchyRequest) ([]*inventory.GetTreeHierarchyResponse_TreeNode, error)
- func (m *MockInventoryServiceClientError) List(ctx context.Context, in *inventory.ResourceFilter) (*inventory.ListResourcesResponse, error)
- func (m *MockInventoryServiceClientError) ListAll(ctx context.Context, filter *inventory.ResourceFilter) ([]*inventory.Resource, error)
- func (m *MockInventoryServiceClientError) ListInheritedTelemetryProfiles(ctx context.Context, ...) (*inventory.ListInheritedTelemetryProfilesResponse, error)
- func (m *MockInventoryServiceClientError) TestGetClientCache() *cache.InventoryCache
- func (m *MockInventoryServiceClientError) TestGetClientCacheUUID() *cache.InventoryCache
- func (m *MockInventoryServiceClientError) TestingOnlySetClient(c inventory.InventoryServiceClient)
- func (m *MockInventoryServiceClientError) Update(ctx context.Context, resID string, fm *fieldmaskpb.FieldMask, ...) (*inventory.Resource, error)
- func (m *MockInventoryServiceClientError) UpdateSubscriptions(ctx context.Context, in []inventory.ResourceKind) error
- type MockResponses
- type MockTenantAwareInventoryServiceClient
- func (m *MockTenantAwareInventoryServiceClient) Create(ctx context.Context, _ string, res *inventory.Resource) (*inventory.Resource, error)
- func (m *MockTenantAwareInventoryServiceClient) Delete(ctx context.Context, _, id string) (*inventory.DeleteResourceResponse, error)
- func (m *MockTenantAwareInventoryServiceClient) DeleteAllResources(ctx context.Context, id string, kind inventory.ResourceKind, _ bool) error
- func (m *MockTenantAwareInventoryServiceClient) Find(ctx context.Context, in *inventory.ResourceFilter) (*inventory.FindResourcesResponse, error)
- func (m *MockTenantAwareInventoryServiceClient) FindAll(ctx context.Context, in *inventory.ResourceFilter) ([]*inventory.FindResourcesResponse_ResourceTenantIDCarrier, error)
- func (m *MockTenantAwareInventoryServiceClient) Get(ctx context.Context, _, id string) (*inventory.GetResourceResponse, error)
- func (m *MockTenantAwareInventoryServiceClient) GetHostByUUID(ctx context.Context, _ string, uuid string) (*computev1.HostResource, error)
- func (m *MockTenantAwareInventoryServiceClient) GetInventoryClient() *MockInventoryServiceClient
- func (m *MockTenantAwareInventoryServiceClient) GetSitesPerRegion(ctx context.Context, in *inventory.GetSitesPerRegionRequest) (*inventory.GetSitesPerRegionResponse, error)
- func (m *MockTenantAwareInventoryServiceClient) GetTreeHierarchy(ctx context.Context, in *inventory.GetTreeHierarchyRequest) ([]*inventory.GetTreeHierarchyResponse_TreeNode, error)
- func (m *MockTenantAwareInventoryServiceClient) List(ctx context.Context, in *inventory.ResourceFilter) (*inventory.ListResourcesResponse, error)
- func (m *MockTenantAwareInventoryServiceClient) ListAll(ctx context.Context, in *inventory.ResourceFilter) ([]*inventory.Resource, error)
- func (m *MockTenantAwareInventoryServiceClient) ListInheritedTelemetryProfiles(ctx context.Context, _ string, ...) (*inventory.ListInheritedTelemetryProfilesResponse, error)
- func (m *MockTenantAwareInventoryServiceClient) TestGetClientCache() *cache.InventoryCache
- func (m *MockTenantAwareInventoryServiceClient) TestGetClientCacheUUID() *cache.InventoryCache
- func (m *MockTenantAwareInventoryServiceClient) TestingOnlySetClient(_ inventory.InventoryServiceClient)
- func (m *MockTenantAwareInventoryServiceClient) Update(ctx context.Context, _, id string, fm *fieldmaskpb.FieldMask, ...) (*inventory.Resource, error)
- func (m *MockTenantAwareInventoryServiceClient) UpdateSubscriptions(ctx context.Context, _ string, kinds []inventory.ResourceKind) error
- type ResourceMaskTuple
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UserNameOne = "userone" UserNameTwo = "usertwo" UserUnexistID = "user-00000000" UserWrongID = "User-123" UserPubKey = "empty" UserPubKeyTwo = "empty-too" Host1Name = "Host-One" Host2Name = "Host-Two" Host2bName = "Host-TwoB" Host3Name = "Host-Three" Host4Name = "Host-Four" HostUnexistID = "host-00000000" HostWrongID = "HOST-123" HostNameNonPrintable = "0x73t116 0x74r114 0x67…… \u2026⟶9 0x65U+200B​ \u200Bh104" HostGUIDNonPrintable = "\u2026⟶9 0x65U+200B​ \u200Bh104" Region1Name = "region-12345678" Region2Name = "region-23456789" Region3Name = "region-00000003" RegionUnexistID = "region-00000000" RegionWrongID = "REGION-123" Site1Name = "site-12345678" Site2Name = "site-12345679" Site3Name = "site-12345670" SiteUnexistID = "site-00000000" SiteWrongID = "SITE-123" OU1Name = "ou-12345678" OU2Name = "ou-12345679" OU3Name = "ou-12345670" OUUnexistID = "ou-00000000" OUWrongID = "OU-1234" EmptyString = "" SschedName1 = "singleSched1" SschedName2 = "singleSched3" SschedName3 = "singleSched3" FutureEpoch = time.Unix(int64(now), 0).Add(1801 * time.Second) SschedStart1 = now + 1800 SschedStart2 = now + 1800 SschedStart3 = now + 1800 SschedEnd1 = now + 3600 SschedEndError = now - 1800 CronAny = "*" SingleScheduleWrongID = "singlesche-XXXXXX" SingleScheduleUnexistID = "singlesche-12345678" RepeatedScheduleWrongID = "repeatedsche-XXXXXX" RepeatedScheduleUnexistID = "repeatedsche-12345678" OSName1 = "OSName1" OSName2 = "OSName2" OSName3 = "OSName3" OSArch1 = "x86_64" OSArch2 = "arch2" OSArch3 = "arch3" OSKernel1 = "k1" OSRepo1 = "OSRepo1" OSRepo2 = "OSRepo2" OSRepo3 = "OSRepo3" OSProfileName1 = "Test OS profile" OSInstalledPackages = "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero" OSSecurityFeature1 = api.SECURITYFEATURENONE OSSecurityFeature2 = api.SECURITYFEATURESECUREBOOTANDFULLDISKENCRYPTION OSTypeImmutable = api.OPERATINGSYSTEMTYPEIMMUTABLE OSProviderInfra = api.OPERATINGSYSTEMPROVIDERINFRA OSResourceWrongID = "os-XXXXXX" OSResourceUnexistID = "os-00000000" WorkloadName1 = "WorkloadName1" WorkloadStatus1 = "WorkloadStatus1" WorkloadName2 = "WorkloadName2" WorkloadStatus2 = "WorkloadStatus2" WorkloadStatus3 = "WorkloadStatus3" WorkloadUnexistID = "workload-00000000" WorkloadWrongID = "workload-XXXXXX" WorkloadMemberUnexistID = "workloadmember-00000000" WorkloadMemberWrongID = "workloadmember-XXXXXX" InstanceUnexistID = "inst-00000000" InstanceWrongID = "inst-XXXXXXXX" Inst1Name = "inst1Name" Inst2Name = "inst2Name" ProviderName1 = "SC LXCA" ProviderName2 = "SC LOCA" ProviderName3 = "Intel" ProviderUnexistID = "provider-00000000" ProviderWrongID = "proider-12345678" MetadataOU1 = api.Metadata{ { Key: "examplekey", Value: "ou1", }, { Key: "examplekey2", Value: "ou1", }, } MetadataOU2 = api.Metadata{ { Key: "examplekey", Value: "ou2", }, { Key: "examplekey2", Value: "ou2", }, } MetadataOU3 = api.Metadata{ { Key: "examplekey2", Value: "ou3", }, { Key: "examplekey3", Value: "ou3", }, } MetadataOU3Rendered = api.Metadata{ { Key: "examplekey", Value: "ou2", }, } MetadataR1 = api.Metadata{ { Key: "examplekey", Value: "r1", }, { Key: "examplekey2", Value: "r1", }, } MetadataR2 = api.Metadata{ { Key: "examplekey", Value: "r2", }, { Key: "examplekey2", Value: "r2", }, } MetadataR3 = api.Metadata{ { Key: "examplekey", Value: "r3", }, } MetadataR3Inherited = api.Metadata{ { Key: "examplekey2", Value: "r2", }, } MetadataSite2 = api.Metadata{ { Key: "examplekey2", Value: "site1", }, } MetadataHost1 = api.Metadata{ { Key: "examplekey1", Value: "host1", }, } MetadataHost2 = api.Metadata{ { Key: "examplekey1", Value: "host2", }, { Key: "examplekey3", Value: "host2", }, } MetadataRightPattern = api.Metadata{ { Key: "asd/ad.123", Value: "site1-.ad", }, { Key: "city", Value: "test-region", }, } MetadataWrongPattern = api.Metadata{ { Key: "/examplekey2", Value: "-site1", }, } Host1UUID1, _ = uuid.Parse("BFD3B398-9A4B-480D-AB53-4050ED108F5C") Host4UUID1, _ = uuid.Parse("BFD3B398-9A4C-481D-AB53-4050ED108F5D") Host1UUIDPatched, _ = uuid.Parse("BFD3B398-9A4B-480D-AB53-4050ED108F5E") HostUUIDUnexists, _ = uuid.Parse("BFD3B398-9A4B-480D-AB53-4050ED108F5F") HostUUIDError = "BFD3B398-9A4B-480D-AB53-4050ED108F5FKK" Host2UUID = uuid.New() Host3UUID = uuid.New() Host5UUID = uuid.New() HostSerialNumber1 = "SN001" HostSerialNumber2 = "SN002" HostSerialNumber3 = "SN003" DnsServers = []string{"10.10.10.10"} Region1Request = api.Region{ Name: &Region1Name, Metadata: &MetadataR1, } Region1RequestWrong = api.Region{} Region1RequestMetadataOK = api.Region{ Name: &Region1Name, Metadata: &MetadataRightPattern, } Region1RequestMetadataNOK = api.Region{ Name: &Region1Name, Metadata: &MetadataWrongPattern, } Region2Request = api.Region{ Name: &Region2Name, Metadata: &MetadataR2, } Region3Request = api.Region{ Name: &Region3Name, Metadata: &MetadataR3, } OU1Request = api.OU{ Name: OU1Name, Metadata: &MetadataOU1, } OU2Request = api.OU{ Name: OU2Name, Metadata: &MetadataOU2, } OU3Request = api.OU{ Name: OU3Name, Metadata: &MetadataOU3, } SiteListRequest = api.Site{ Name: &Site1Name, DnsServers: &DnsServers, } SiteListRequest1 = api.Site{ Name: &Site1Name, DnsServers: &DnsServers, } SiteListRequest2 = api.Site{ Name: &Site2Name, DnsServers: &DnsServers, } SiteListRequest3 = api.Site{ Name: &Site3Name, DnsServers: &DnsServers, } Site1Request = api.Site{ Name: &Site1Name, DnsServers: &DnsServers, } Site1RequestUpdate = api.Site{ Name: &Site1Name, DnsServers: &DnsServers, } Site1RequestUpdatePatch = api.Site{ Name: &Site2Name, DnsServers: &DnsServers, } Site2Request = api.Site{ Name: &Site2Name, DnsServers: &DnsServers, Metadata: &MetadataSite2, } Site3Request = api.Site{ Name: &Site3Name, DnsServers: &DnsServers, Metadata: &MetadataSite2, } Host1Request = api.Host{ Name: Host1Name, Metadata: &metadata, Uuid: &Host1UUID1, } Host1RequestPut = api.Host{ Name: Host1Name, Metadata: &metadata, } Host1RequestUpdate = api.Host{ Metadata: &api.Metadata{ { Key: "examplekey", Value: "examplevalue", }, { Key: "examplekey2", Value: "examplevalue2", }, }, Name: Host2Name, SiteId: &Site2Name, } Host1RequestUpdatePowerON = api.Host{ DesiredPowerState: &powerHostON, } Host1RequestUpdatePowerOFF = api.Host{ DesiredPowerState: &powerHostOFF, } Host1RequestPatch = api.Host{ Metadata: &api.Metadata{ { Key: "examplekey", Value: "examplevalue", }, { Key: "examplekey2", Value: "examplevalue2", }, }, Name: Host3Name, SiteId: &Site2Name, } Host2Request = api.Host{ Name: Host2Name, Metadata: &metadata, Uuid: &Host2UUID, } HostReqFilterMeta1 = api.Host{ Metadata: &metadata1, Uuid: &Host1UUID1, } HostReqFilterMeta2 = api.Host{ Metadata: &metadata2, Uuid: &Host2UUID, } Host3Request = api.Host{ Metadata: &api.Metadata{ { Key: "examplekey", Value: "examplevalue", }, { Key: "examplekey2", Value: "examplevalue2", }, }, Name: Host1Name, SiteId: &Site1Name, Uuid: &Host3UUID, } Host4Request = api.Host{ Name: Host4Name, Uuid: &Host4UUID1, } Host4RequestPut = api.Host{ Metadata: &api.Metadata{ { Key: "examplekey", Value: "examplevalue", }, { Key: "examplekey2", Value: "examplevalue2", }, }, Name: Host4Name, SiteId: &Site1Name, } Host4RequestPatch = api.Host{ Metadata: &api.Metadata{ { Key: "examplekey", Value: "examplevalue", }, { Key: "examplekey2", Value: "examplevalue2", }, }, Name: Host4Name, SiteId: &Site1Name, } HostNonPrintable = api.Host{ Metadata: &api.Metadata{ { Key: "examplekey", Value: "examplevalue", }, { Key: "examplekey2", Value: "examplevalue2", }, }, Name: HostNameNonPrintable, SiteId: &Site1Name, Uuid: &Host1UUID1, } HostRegister = api.HostRegisterInfo{ Name: &Host1Name, Uuid: &Host2UUID, SerialNumber: &HostSerialNumber1, } AutoOnboardTrue bool = true AutoOnboardFalse bool = false HostRegisterAutoOnboard = api.HostRegisterInfo{ Name: &Host2Name, Uuid: &Host3UUID, SerialNumber: &HostSerialNumber2, AutoOnboard: &AutoOnboardTrue, } HostRegisterPatch = api.PatchComputeHostsHostIDRegisterJSONRequestBody{ Name: &Host3Name, } HostRegisterPatchAutoOnboard = api.PatchComputeHostsHostIDRegisterJSONRequestBody{ AutoOnboard: &AutoOnboardTrue, } SingleSchedule1Request = api.SingleSchedule{ Name: &SschedName1, StartSeconds: SschedStart1, EndSeconds: &SschedEnd1, ScheduleStatus: api.SCHEDULESTATUSMAINTENANCE, } SingleSchedule2Request = api.SingleSchedule{ Name: &SschedName2, StartSeconds: SschedStart2, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } SingleSchedule3Request = api.SingleSchedule{ Name: &SschedName3, StartSeconds: SschedStart3, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } SingleScheduleError = api.SingleSchedule{ Name: &SschedName3, StartSeconds: SschedStart3, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } SingleScheduleErrorSeconds = api.SingleSchedule{ Name: &SschedName3, StartSeconds: SschedStart3, EndSeconds: &SschedEndError, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } RepeatedSchedule1Request = api.RepeatedSchedule{ Name: &SschedName1, DurationSeconds: 1, CronDayMonth: cronDayMonth, CronMinutes: CronAny, CronHours: CronAny, CronMonth: CronAny, CronDayWeek: CronAny, ScheduleStatus: api.SCHEDULESTATUSMAINTENANCE, } RepeatedSchedule2Request = api.RepeatedSchedule{ Name: &SschedName2, DurationSeconds: 5, CronMinutes: CronAny, CronHours: CronAny, CronDayMonth: CronAny, CronMonth: CronAny, CronDayWeek: CronAny, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } RepeatedSchedule3Request = api.RepeatedSchedule{ Name: &SschedName3, DurationSeconds: 86400, CronMinutes: CronAny, CronHours: CronAny, CronDayMonth: CronAny, CronMonth: CronAny, CronDayWeek: CronAny, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } RepeatedScheduleError = api.RepeatedSchedule{ Name: &SschedName3, DurationSeconds: 86400, CronMinutes: CronAny, CronHours: CronAny, CronDayMonth: CronAny, CronMonth: CronAny, CronDayWeek: CronAny, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } RepeatedMissingRequest = api.RepeatedSchedule{ Name: &SschedName3, DurationSeconds: 86400, CronMinutes: CronAny, CronHours: CronAny, CronDayMonth: CronAny, CronMonth: CronAny, ScheduleStatus: api.SCHEDULESTATUSOSUPDATE, } RepeatedScheduleCronReqErr = api.RepeatedSchedule{ Name: &SschedName3, DurationSeconds: 86400, CronMinutes: "/5", CronHours: "*", CronDayMonth: "*", CronMonth: "*", CronDayWeek: "*", ScheduleStatus: api.SCHEDULESTATUSMAINTENANCE, } SingleScheduleAlwaysRequest = api.SingleSchedule{ Name: &SschedName1, StartSeconds: SschedStart2, ScheduleStatus: api.SCHEDULESTATUSMAINTENANCE, } SingleScheduleNever = api.SingleSchedule{ Name: &SschedName2, StartSeconds: SschedStart2, EndSeconds: &SschedEnd1, ScheduleStatus: api.SCHEDULESTATUSMAINTENANCE, } RepeatedScheduleAlwaysRequest = api.RepeatedSchedule{ Name: &SschedName1, DurationSeconds: 120, CronMinutes: CronAny, CronHours: CronAny, CronDayMonth: CronAny, CronMonth: CronAny, CronDayWeek: CronAny, ScheduleStatus: api.SCHEDULESTATUSMAINTENANCE, } OSResource1Request = api.OperatingSystemResource{ Name: &OSName1, KernelCommand: &OSKernel1, Architecture: &OSArch1, UpdateSources: []string{"sourcesList"}, RepoUrl: &OSRepo1, Sha256: inv_testing.GenerateRandomSha256(), SecurityFeature: &OSSecurityFeature1, OsType: &OSTypeImmutable, OsProvider: &OSProviderInfra, } OSResource2Request = api.OperatingSystemResource{ Name: &OSName2, Architecture: &OSArch2, UpdateSources: []string{"sourcesList"}, RepoUrl: &OSRepo2, Sha256: inv_testing.GenerateRandomSha256(), ProfileName: &OSProfileName1, SecurityFeature: &OSSecurityFeature2, OsType: &OSTypeImmutable, OsProvider: &OSProviderInfra, } OSResourceRequestInvalidSha256 = api.OperatingSystemResource{ Name: &OSName3, Architecture: &OSArch3, UpdateSources: []string{"sourcesList"}, RepoUrl: &OSRepo3, Sha256: strings.ToUpper(inv_testing.GenerateRandomSha256()), } OSResourceRequestNoUpdateSources = api.OperatingSystemResource{ Name: &OSName3, Architecture: &OSArch3, RepoUrl: &OSRepo3, Sha256: inv_testing.GenerateRandomSha256(), } OSResourceRequestNoRepoURL = api.OperatingSystemResource{ Name: &OSName3, Architecture: &OSArch3, UpdateSources: []string{"sourcesList"}, Sha256: inv_testing.GenerateRandomSha256(), } OSResourceRequestNoSha = api.OperatingSystemResource{ Name: &OSName3, Architecture: &OSArch3, RepoUrl: &OSRepo3, UpdateSources: []string{"sourcesList"}, } OSResource1ReqwithInstallPackages = api.OperatingSystemResource{ Name: &OSName1, KernelCommand: &OSKernel1, Architecture: &OSArch1, UpdateSources: []string{"sourcesList"}, RepoUrl: &OSRepo1, Sha256: inv_testing.GenerateRandomSha256(), InstalledPackages: &OSInstalledPackages, OsType: &OSTypeImmutable, OsProvider: &OSProviderInfra, } WorkloadCluster1Request = api.Workload{ Name: &WorkloadName1, Kind: api.WORKLOADKINDCLUSTER, Status: &WorkloadStatus1, ExternalId: &clusterUuid1, } WorkloadCluster2Request = api.Workload{ Name: &WorkloadName2, Kind: api.WORKLOADKINDCLUSTER, Status: &WorkloadStatus2, } WorkloadCluster3Request = api.Workload{ Kind: api.WORKLOADKINDCLUSTER, Status: &WorkloadStatus2, } WorkloadNoKind = api.Workload{ Name: &WorkloadName2, Status: &WorkloadStatus2, } Instance1Request = api.Instance{ HostID: &instHostID, OsID: &instOSID, Kind: &instKind, Name: &Inst1Name, } Instance2Request = api.Instance{ HostID: &instHostID, OsID: &instOSID, Kind: &instKind, Name: &Inst2Name, SecurityFeature: &instSecurityFeature, } InstanceRequestPatch = api.Instance{ Kind: &instKind, Name: &Inst2Name, SecurityFeature: &instSecurityFeature, } InstanceRequestNoOSID = api.Instance{ HostID: &instHostID, Kind: &instKind, Name: &Inst2Name, } InstanceRequestNoHostID = api.Instance{ OsID: &instOSID, Kind: &instKind, Name: &Inst2Name, } TelemetryLogsGroup1Request = api.TelemetryLogsGroup{ Name: "HW Usage", CollectorKind: api.TELEMETRYCOLLECTORKINDHOST, Groups: []string{ "syslog", }, } TelemetryMetricsGroup1Request = api.TelemetryMetricsGroup{ Name: "Network Usage", CollectorKind: api.TELEMETRYCOLLECTORKINDHOST, Groups: []string{ "net", "netstat", "ethtool", }, } Provider1Request = api.Provider{ ProviderKind: providerKind1, ProviderVendor: &providerVendor1, Name: ProviderName1, ApiEndpoint: providerApiEndpoint1, ApiCredentials: &providerApiCredentials1, Config: &providerConfig1, } Provider2Request = api.Provider{ ProviderKind: providerKind2, ProviderVendor: &providerVendor2, Name: ProviderName2, ApiEndpoint: providerApiEndpoint2, ApiCredentials: &providerApiCredentials2, } Provider3Request = api.Provider{ ProviderKind: providerKind3, Name: ProviderName3, ApiEndpoint: providerApiEndpoint3, } ProviderNoKind = api.Provider{ ProviderVendor: &providerVendor1, Name: ProviderName1, ApiEndpoint: providerApiEndpoint1, ApiCredentials: &providerApiCredentials1, } ProviderNoName = api.Provider{ ProviderKind: providerKind1, ProviderVendor: &providerVendor1, ApiEndpoint: providerApiEndpoint1, ApiCredentials: &providerApiCredentials1, } ProviderNoApiEndpoint = api.Provider{ ProviderKind: providerKind1, ProviderVendor: &providerVendor1, Name: ProviderName1, ApiCredentials: &providerApiCredentials1, } ProviderBadCredentials = api.Provider{ ProviderKind: providerKind1, ProviderVendor: &providerVendor1, Name: ProviderName1, ApiCredentials: &providerBadApiCredentials, } )
View Source
var ( SingleSchedResID = "singlesche-12345678" RepeatedSchedResID = "repeatedsche-12345678" GPUDescription = "some desc" GPUModel = "Model XYZ" GPUVendor = "Intel" GPUPciID = "00:00.1" GPUName = "gpu0" GPUResourceID = "hostgpu-12345678" )
Functions ¶
This section is empty.
Types ¶
type MockInventoryServiceClient ¶
type MockInventoryServiceClient struct {
FindResourcesCallCount int
FindResourcesCalls []*inventory.ResourceFilter
FindResourcesResponse *inventory.FindResourcesResponse
FindAllResourcesCallCount int
FindAllResourcesCalls []*inventory.ResourceFilter
FindAllResourcesResponse []*inventory.FindResourcesResponse_ResourceTenantIDCarrier
ListAllResourcesCallCount int
ListAllResourcesCalls []*inventory.ResourceFilter
ListAllResourcesResponse []*inventory.Resource
ListResourcesCallCount int
ListResourcesLimit uint32
ListResourcesOffset uint32
ListResourcesOrderBy string
ListResourcesFilter string
ListResourcesCalls []*inventory.ResourceFilter
ListResourcesResponse *inventory.ListResourcesResponse
DeleteResourceCallCount int
DeleteResourceResponse *inventory.DeleteResourceResponse
DeleteAllResourcesCallCount int
GetResourceCallCount int
GetResourceResponse *inventory.GetResourceResponse
UpdateResourceCallCount int
UpdateResourceResponse *inventory.Resource
CreateResourceCallCount int
CreateResourceResponse *inventory.Resource
LastUpdateResourceRequest string
LastUpdateResourceRequestFieldMask *fieldmaskpb.FieldMask
}
func NewMockInventoryServiceClient ¶
func NewMockInventoryServiceClient(responses MockResponses) *MockInventoryServiceClient
func (*MockInventoryServiceClient) Close ¶
func (m *MockInventoryServiceClient) Close() error
func (*MockInventoryServiceClient) Delete ¶
func (m *MockInventoryServiceClient) Delete(ctx context.Context, in string) (*inventory.DeleteResourceResponse, error)
func (*MockInventoryServiceClient) DeleteAllResources ¶
func (m *MockInventoryServiceClient) DeleteAllResources(ctx context.Context, in string, kind inventory.ResourceKind) error
func (*MockInventoryServiceClient) Find ¶
func (m *MockInventoryServiceClient) Find( ctx context.Context, in *inventory.ResourceFilter, ) (*inventory.FindResourcesResponse, error)
func (*MockInventoryServiceClient) FindAll ¶
func (m *MockInventoryServiceClient) FindAll(ctx context.Context, filter *inventory.ResourceFilter) ( []*inventory.FindResourcesResponse_ResourceTenantIDCarrier, error, )
func (*MockInventoryServiceClient) Get ¶
func (m *MockInventoryServiceClient) Get(ctx context.Context, in string) (*inventory.GetResourceResponse, error)
func (*MockInventoryServiceClient) GetHostByUUID ¶
func (m *MockInventoryServiceClient) GetHostByUUID(ctx context.Context, uuid string) (*computev1.HostResource, error)
func (*MockInventoryServiceClient) GetSitesPerRegion ¶
func (m *MockInventoryServiceClient) GetSitesPerRegion( ctx context.Context, getReq *inventory.GetSitesPerRegionRequest, ) (*inventory.GetSitesPerRegionResponse, error)
func (*MockInventoryServiceClient) GetTenantAwareInventoryClient ¶
func (m *MockInventoryServiceClient) GetTenantAwareInventoryClient() client.TenantAwareInventoryClient
func (*MockInventoryServiceClient) GetTreeHierarchy ¶
func (m *MockInventoryServiceClient) GetTreeHierarchy( ctx context.Context, getTreeReq *inventory.GetTreeHierarchyRequest, ) ([]*inventory.GetTreeHierarchyResponse_TreeNode, error)
func (*MockInventoryServiceClient) List ¶
func (m *MockInventoryServiceClient) List( ctx context.Context, in *inventory.ResourceFilter, ) (*inventory.ListResourcesResponse, error)
func (*MockInventoryServiceClient) ListAll ¶
func (m *MockInventoryServiceClient) ListAll(ctx context.Context, filter *inventory.ResourceFilter) ([]*inventory.Resource, error)
func (*MockInventoryServiceClient) ListInheritedTelemetryProfiles ¶
func (m *MockInventoryServiceClient) ListInheritedTelemetryProfiles( ctx context.Context, inheritBy *inventory.ListInheritedTelemetryProfilesRequest_InheritBy, filter string, orderBy string, limit, offset uint32, ) (*inventory.ListInheritedTelemetryProfilesResponse, error)
func (*MockInventoryServiceClient) TestGetClientCache ¶
func (m *MockInventoryServiceClient) TestGetClientCache() *cache.InventoryCache
func (*MockInventoryServiceClient) TestGetClientCacheUUID ¶
func (m *MockInventoryServiceClient) TestGetClientCacheUUID() *cache.InventoryCache
func (*MockInventoryServiceClient) TestingOnlySetClient ¶
func (m *MockInventoryServiceClient) TestingOnlySetClient(c inventory.InventoryServiceClient)
func (*MockInventoryServiceClient) UpdateSubscriptions ¶
func (m *MockInventoryServiceClient) UpdateSubscriptions( ctx context.Context, in []inventory.ResourceKind, ) error
type MockInventoryServiceClientError ¶
type MockInventoryServiceClientError struct{}
func NewMockInventoryServiceClientError ¶
func NewMockInventoryServiceClientError() *MockInventoryServiceClientError
func (*MockInventoryServiceClientError) Close ¶
func (m *MockInventoryServiceClientError) Close() error
func (*MockInventoryServiceClientError) Delete ¶
func (m *MockInventoryServiceClientError) Delete(ctx context.Context, in string) (*inventory.DeleteResourceResponse, error)
func (*MockInventoryServiceClientError) DeleteAllResources ¶
func (m *MockInventoryServiceClientError) DeleteAllResources(ctx context.Context, in string, kind inventory.ResourceKind, _ bool) error
func (*MockInventoryServiceClientError) Find ¶
func (m *MockInventoryServiceClientError) Find( ctx context.Context, in *inventory.ResourceFilter, ) (*inventory.FindResourcesResponse, error)
func (*MockInventoryServiceClientError) FindAll ¶
func (m *MockInventoryServiceClientError) FindAll(ctx context.Context, filter *inventory.ResourceFilter) ( []*inventory.FindResourcesResponse_ResourceTenantIDCarrier, error, )
func (*MockInventoryServiceClientError) Get ¶
func (m *MockInventoryServiceClientError) Get(ctx context.Context, in string) (*inventory.GetResourceResponse, error)
func (*MockInventoryServiceClientError) GetHostByUUID ¶
func (m *MockInventoryServiceClientError) GetHostByUUID(ctx context.Context, uuid string) (*computev1.HostResource, error)
func (*MockInventoryServiceClientError) GetSitesPerRegion ¶
func (m *MockInventoryServiceClientError) GetSitesPerRegion( ctx context.Context, getReq *inventory.GetSitesPerRegionRequest, ) (*inventory.GetSitesPerRegionResponse, error)
func (*MockInventoryServiceClientError) GetTenantAwareInventoryClient ¶
func (m *MockInventoryServiceClientError) GetTenantAwareInventoryClient() client.TenantAwareInventoryClient
func (*MockInventoryServiceClientError) GetTreeHierarchy ¶
func (m *MockInventoryServiceClientError) GetTreeHierarchy( ctx context.Context, getTreeReq *inventory.GetTreeHierarchyRequest, ) ([]*inventory.GetTreeHierarchyResponse_TreeNode, error)
func (*MockInventoryServiceClientError) List ¶
func (m *MockInventoryServiceClientError) List( ctx context.Context, in *inventory.ResourceFilter, ) (*inventory.ListResourcesResponse, error)
func (*MockInventoryServiceClientError) ListAll ¶
func (m *MockInventoryServiceClientError) ListAll(ctx context.Context, filter *inventory.ResourceFilter) ([]*inventory.Resource, error)
func (*MockInventoryServiceClientError) ListInheritedTelemetryProfiles ¶
func (m *MockInventoryServiceClientError) ListInheritedTelemetryProfiles( ctx context.Context, inheritBy *inventory.ListInheritedTelemetryProfilesRequest_InheritBy, filter string, orderBy string, limit, offset uint32, ) (*inventory.ListInheritedTelemetryProfilesResponse, error)
func (*MockInventoryServiceClientError) TestGetClientCache ¶
func (m *MockInventoryServiceClientError) TestGetClientCache() *cache.InventoryCache
func (*MockInventoryServiceClientError) TestGetClientCacheUUID ¶
func (m *MockInventoryServiceClientError) TestGetClientCacheUUID() *cache.InventoryCache
func (*MockInventoryServiceClientError) TestingOnlySetClient ¶
func (m *MockInventoryServiceClientError) TestingOnlySetClient(c inventory.InventoryServiceClient)
func (*MockInventoryServiceClientError) UpdateSubscriptions ¶
func (m *MockInventoryServiceClientError) UpdateSubscriptions( ctx context.Context, in []inventory.ResourceKind, ) error
type MockResponses ¶
type MockResponses struct {
FindResourcesResponse *inventory.FindResourcesResponse
FindAllResourcesResponse []string
ListResourcesResponse *inventory.ListResourcesResponse
DeleteResourceResponse *inventory.DeleteResourceResponse
GetResourceResponse *inventory.GetResourceResponse
UpdateResourceResponse *inventory.Resource
CreateResourceResponse *inventory.Resource
}
type MockTenantAwareInventoryServiceClient ¶
type MockTenantAwareInventoryServiceClient struct {
*MockInventoryServiceClient
}
TODO: implement proper mock.
func NewTenantAwareMockInventoryServiceClient ¶
func NewTenantAwareMockInventoryServiceClient(responses MockResponses) *MockTenantAwareInventoryServiceClient
func (*MockTenantAwareInventoryServiceClient) Delete ¶
func (m *MockTenantAwareInventoryServiceClient) Delete(ctx context.Context, _, id string) ( *inventory.DeleteResourceResponse, error, )
func (*MockTenantAwareInventoryServiceClient) DeleteAllResources ¶
func (m *MockTenantAwareInventoryServiceClient) DeleteAllResources(ctx context.Context, id string, kind inventory.ResourceKind, _ bool) error
func (*MockTenantAwareInventoryServiceClient) Find ¶
func (m *MockTenantAwareInventoryServiceClient) Find(ctx context.Context, in *inventory.ResourceFilter) (*inventory.FindResourcesResponse, error)
func (*MockTenantAwareInventoryServiceClient) FindAll ¶
func (m *MockTenantAwareInventoryServiceClient) FindAll(ctx context.Context, in *inventory.ResourceFilter) ( []*inventory.FindResourcesResponse_ResourceTenantIDCarrier, error, )
func (*MockTenantAwareInventoryServiceClient) Get ¶
func (m *MockTenantAwareInventoryServiceClient) Get(ctx context.Context, _, id string) (*inventory.GetResourceResponse, error)
func (*MockTenantAwareInventoryServiceClient) GetHostByUUID ¶
func (m *MockTenantAwareInventoryServiceClient) GetHostByUUID(ctx context.Context, _ string, uuid string) (*computev1.HostResource, error)
func (*MockTenantAwareInventoryServiceClient) GetInventoryClient ¶
func (m *MockTenantAwareInventoryServiceClient) GetInventoryClient() *MockInventoryServiceClient
func (*MockTenantAwareInventoryServiceClient) GetSitesPerRegion ¶
func (m *MockTenantAwareInventoryServiceClient) GetSitesPerRegion(ctx context.Context, in *inventory.GetSitesPerRegionRequest) ( *inventory.GetSitesPerRegionResponse, error, )
func (*MockTenantAwareInventoryServiceClient) GetTreeHierarchy ¶
func (m *MockTenantAwareInventoryServiceClient) GetTreeHierarchy(ctx context.Context, in *inventory.GetTreeHierarchyRequest) ( []*inventory.GetTreeHierarchyResponse_TreeNode, error, )
func (*MockTenantAwareInventoryServiceClient) List ¶
func (m *MockTenantAwareInventoryServiceClient) List(ctx context.Context, in *inventory.ResourceFilter) (*inventory.ListResourcesResponse, error)
func (*MockTenantAwareInventoryServiceClient) ListAll ¶
func (m *MockTenantAwareInventoryServiceClient) ListAll(ctx context.Context, in *inventory.ResourceFilter) ([]*inventory.Resource, error)
func (*MockTenantAwareInventoryServiceClient) ListInheritedTelemetryProfiles ¶
func (m *MockTenantAwareInventoryServiceClient) ListInheritedTelemetryProfiles( ctx context.Context, _ string, inheritBy *inventory.ListInheritedTelemetryProfilesRequest_InheritBy, filter string, orderBy string, limit, offset uint32, ) (*inventory.ListInheritedTelemetryProfilesResponse, error)
func (*MockTenantAwareInventoryServiceClient) TestGetClientCache ¶
func (m *MockTenantAwareInventoryServiceClient) TestGetClientCache() *cache.InventoryCache
func (*MockTenantAwareInventoryServiceClient) TestGetClientCacheUUID ¶
func (m *MockTenantAwareInventoryServiceClient) TestGetClientCacheUUID() *cache.InventoryCache
func (*MockTenantAwareInventoryServiceClient) TestingOnlySetClient ¶
func (m *MockTenantAwareInventoryServiceClient) TestingOnlySetClient(_ inventory.InventoryServiceClient)
func (*MockTenantAwareInventoryServiceClient) UpdateSubscriptions ¶
func (m *MockTenantAwareInventoryServiceClient) UpdateSubscriptions(ctx context.Context, _ string, kinds []inventory.ResourceKind) error
type ResourceMaskTuple ¶
type ResourceMaskTuple struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.