|
|
@@ -7,6 +7,7 @@ import (
|
|
|
"github.com/opencost/opencost/pkg/cloud/aws"
|
|
|
"github.com/opencost/opencost/pkg/cloud/azure"
|
|
|
"github.com/opencost/opencost/pkg/cloud/gcp"
|
|
|
+ "github.com/opencost/opencost/pkg/cloud/oracle"
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
@@ -207,6 +208,24 @@ var (
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
+
|
|
|
+ OCIUsageAPIConfigurations = &Configurations{
|
|
|
+ OCI: &OCIConfigs{
|
|
|
+ UsageAPI: []*oracle.UsageApiConfiguration{
|
|
|
+ {
|
|
|
+ TenancyID: "ocid1.tenancy.oc1..tenancyID",
|
|
|
+ Region: "us-ashburn-1",
|
|
|
+ Authorizer: &oracle.RawConfigProvider{
|
|
|
+ TenancyID: "ocid1.tenancy.oc1..tenancyID",
|
|
|
+ UserID: "ocid1.user.oc1..userID",
|
|
|
+ Region: "us-ashburn-1",
|
|
|
+ Fingerprint: "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00",
|
|
|
+ PrivateKey: "dummy-private-key",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
func TestConfigurations_UnmarshalJSON(t *testing.T) {
|
|
|
@@ -270,6 +289,10 @@ func TestConfigurations_UnmarshalJSON(t *testing.T) {
|
|
|
input: AWSS3AssumeRoleAccessKeyMultiCloudConfig,
|
|
|
expected: AWSS3AssumeRoleAccessKeyConfigurations,
|
|
|
},
|
|
|
+ "OCI UsageAPI RawConfigProvider": {
|
|
|
+ input: OCIUsageAPIConfigurations,
|
|
|
+ expected: OCIUsageAPIConfigurations,
|
|
|
+ },
|
|
|
}
|
|
|
for name, tt := range tests {
|
|
|
t.Run(name, func(t *testing.T) {
|