blob: 13b5160526e5ed579ed1dbcc751a746fcaccab7b [file] [log] [blame]
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef THIRD_PARTY_ECCLESIA_LIB_REDFISH_AUTHORIZER_ENUMS_H_
#define THIRD_PARTY_ECCLESIA_LIB_REDFISH_AUTHORIZER_ENUMS_H_
#include <cstdint>
#include <string>
#include "absl/strings/string_view.h"
namespace ecclesia {
enum class ResourceEntity : int {
// go/keep-sorted start
kAccelerationFunction = 0,
kAccelerationFunctionCollection,
kAccountService,
kActionInfo,
kAddressPool,
kAddressPoolCollection,
kAggregate,
kAggregateCollection,
kAggregationService,
kAggregationSource,
kAggregationSourceCollection,
kAllowDeny,
kAllowDenyCollection,
kAssembly,
kBattery,
kBatteryCollection,
kBatteryMetrics,
kBios,
kBootOption,
kBootOptionCollection,
kCXLLogicalDevice,
kCXLLogicalDeviceCollection,
kCable,
kCableCollection,
kCertificate,
kCertificateCollection,
kCertificateLocations,
kCertificateService,
kChassis,
kChassisCollection,
kCircuit,
kCircuitCollection,
kComponentIntegrity,
kComponentIntegrityCollection,
kCompositionReservation,
kCompositionReservationCollection,
kCompositionService,
kComputerSystem,
kComputerSystemCollection,
kConnection,
kConnectionCollection,
kConnectionMethod,
kConnectionMethodCollection,
kControl,
kControlCollection,
kDrive,
kDriveCollection,
kEndpoint,
kEndpointCollection,
kEndpointGroup,
kEndpointGroupCollection,
kEnvironmentMetrics,
kEthernetInterface,
kEthernetInterfaceCollection,
kEventDestination,
kEventDestinationCollection,
kEventService,
kExternalAccountProvider,
kExternalAccountProviderCollection,
kFabric,
kFabricAdapter,
kFabricAdapterCollection,
kFabricCollection,
kFacility,
kFacilityCollection,
kFan,
kFanCollection,
kGoogleAsicErrorCounters,
kGoogleAsicFleetCounters,
kGoogleAsicHbmErrors,
kGoogleAsicHbmPcr,
kGoogleAsicHbmPpr,
kGoogleAsicUtilization,
kGoogleBareMetalInstance,
kGoogleBootTime,
kGoogleErrorCounter,
kGoogleErrorCounterCollection,
kGoogleHbmOnlineRepair,
kGoogleManagedObjectStoreMetrics,
kGoogleNvmeMetric,
kGooglePower,
kGooglePowerTpu,
kGooglePowerTpuCollection,
kGooglePowerVCore,
kGooglePowerVCoreCollection,
kGoogleProcessor,
kGoogleRasService,
kGooglegRPCStatistics,
kGraphicsController,
kGraphicsControllerCollection,
kHeater,
kHeaterCollection,
kHeaterMetrics,
kHostInterface,
kHostInterfaceCollection,
kJob,
kJobCollection,
kJobService,
kJsonSchemaFile,
kJsonSchemaFileCollection,
kKey,
kKeyCollection,
kKeyPolicy,
kKeyPolicyCollection,
kKeyService,
kLogEntry,
kLogEntryCollection,
kLogService,
kLogServiceCollection,
kManager,
kManagerAccount,
kManagerAccountCollection,
kManagerCollection,
kManagerDiagnosticData,
kManagerNetworkProtocol,
kMediaController,
kMediaControllerCollection,
kMemory,
kMemoryChunks,
kMemoryChunksCollection,
kMemoryCollection,
kMemoryDomain,
kMemoryDomainCollection,
kMemoryMetrics,
kMessageRegistryFile,
kMessageRegistryFileCollection,
kMetricDefinition,
kMetricDefinitionCollection,
kMetricReport,
kMetricReportCollection,
kMetricReportDefinition,
kMetricReportDefinitionCollection,
kNVMe,
kNVMeCollection,
kNVMeController,
kNVMeControllerCollection,
kNetworkAdapter,
kNetworkAdapterCollection,
kNetworkAdapterMetrics,
kNetworkDeviceFunction,
kNetworkDeviceFunctionCollection,
kNetworkDeviceFunctionMetrics,
kNetworkInterface,
kNetworkInterfaceCollection,
kNetworkPort,
kNetworkPortCollection,
kNvidiaDebugToken,
kNvidiaDebugTokenService,
kNvidiaErrorInjection,
kNvidiaHistogram,
kNvidiaHistogramBucket,
kNvidiaHistogramBuckets,
kNvidiaHistogramCollection,
kNvidiaPowerSmoothing,
kNvidiaPowerSmoothingPresetProfile,
kNvidiaPowerSmoothingPresetProfileCollection,
kNvidiaRoTImageSlot,
kNvidiaRoTImageSlotCollection,
kNvidiaRoTProtectedComponent,
kNvidiaRoTProtectedComponentCollection,
kNvidiaRoTProtectedComponentSettings,
kNvidiaSwitchPowerMode,
kNvidiaWorkloadPower,
kNvidiaWorkloadPowerProfile,
kNvidiaWorkloadPowerProfileCollection,
kOperatingConfig,
kOperatingConfigCollection,
kOutlet,
kOutletCollection,
kOutletGroup,
kOutletGroupCollection,
kPCIeDevice,
kPCIeDeviceCollection,
kPCIeFunction,
kPCIeFunctionCollection,
kPCIeSlots,
kPort,
kPortCollection,
kPortMetrics,
kPortSettings,
kPower,
kPowerDistribution,
kPowerDistributionCollection,
kPowerDistributionMetrics,
kPowerDomain,
kPowerDomainCollection,
kPowerEquipment,
kPowerSubsystem,
kPowerSupply,
kPowerSupplyCollection,
kPowerSupplyMetrics,
kPrivilegeRegistry,
kProcessor,
kProcessorCollection,
kProcessorMetrics,
kResourceBlock,
kResourceBlockCollection,
kRole,
kRoleCollection,
kRootOfTrust,
kRootOfTrustCollection,
kRouteEntry,
kRouteEntryCollection,
kRouteSetEntry,
kRouteSetEntryCollection,
kSecureBoot,
kSecureBootDatabase,
kSecureBootDatabaseCollection,
kSensor,
kSensorCollection,
kSerialInterface,
kSerialInterfaceCollection,
kServiceRoot,
kSession,
kSessionCollection,
kSessionService,
kSignature,
kSignatureCollection,
kSimpleStorage,
kSimpleStorageCollection,
kSoftwareInventory,
kSoftwareInventoryCollection,
kStorage,
kStorageCollection,
kStorageController,
kStorageControllerCollection,
kSwitch,
kSwitchCollection,
kTask,
kTaskCollection,
kTaskService,
kTelemetryService,
kThermal,
kThermalMetrics,
kThermalSubsystem,
kTlBMCAllChassis,
kTlBMCAllSensors,
kTlBMCDebugApp,
kTlBMCDebugEndpoint,
kTlBMCDebugStore,
kTlBMCMetrics,
kTlBMCSchedulerStats,
kTlBMCServiceRoot,
kTriggers,
kTriggersCollection,
kTrustedComponent,
kTrustedComponentCollection,
kUSBController,
kUSBControllerCollection,
kUpdateService,
kVCATEntry,
kVCATEntryCollection,
kVLanNetworkInterface,
kVLanNetworkInterfaceCollection,
kVirtualMedia,
kVirtualMediaCollection,
kVolume,
kVolumeCollection,
kZone,
kZoneCollection,
// go/keep-sorted end
kUndefined,
};
enum class Operation : uint8_t {
kDelete = 0,
kGet,
kHead,
kPatch,
kPost,
kPut,
kUndefined,
};
// copybara:strip_begin(g3-shared-libs)
// Returns the string representation of the given resource entity.
std::string ResourceEntityToString(ResourceEntity entity);
// Returns the string representation of the given operation.
std::string OperationToString(Operation operation);
// Returns the resource entity of the given string.
ResourceEntity StringToResourceEntity(absl::string_view resource);
// Returns the operation of the given string.
Operation StringToOperation(absl::string_view operation);
// copybara:strip_end
} // namespace ecclesia
#endif // THIRD_PARTY_ECCLESIA_LIB_REDFISH_AUTHORIZER_ENUMS_H_