This pull request includes several changes to add support for licensing API domains and new data sources for tenant information. The most important changes include updates to constants, new data source documentation, and modifications to the provider configuration and tests.
Constants Update:
constants/constants.go: Added new constants for PUBLIC_LICENSING_API_DOMAIN, USDOD_LICENSING_API_DOMAIN, USGOV_LICENSING_API_DOMAIN, USGOVHIGH_LICENSING_API_DOMAIN, CHINA_LICENSING_API_DOMAIN, EX_LICENSING_API_DOMAIN, and RX_LICENSING_API_DOMAIN. [1][2][3][4][5][6][7]
Documentation:
docs/data-sources/tenant.md: Added documentation for the powerplatform_tenant data source, which fetches the client configuration for a given tenant.
docs/data-sources/tenant_capacity.md: Added documentation for the powerplatform_tenant_capacity data source, which fetches the capacity information for a given tenant.
internal/powerplatform/services/capacity/api_capacity.go: Added a new client for handling capacity-related API calls.This pull request introduces several changes to support the new licensing API domain and adds a new data source for tenant capacity in the PowerPlatform provider.
Licensing API Domain Updates:
Added PUBLIC_LICENSING_API_DOMAIN to constants/constants.go.
Added USDOD_LICENSING_API_DOMAIN to constants/constants.go.
Added USGOV_LICENSING_API_DOMAIN to constants/constants.go.
Added USGOVHIGH_LICENSING_API_DOMAIN to constants/constants.go.
Added CHINA_LICENSING_API_DOMAIN to constants/constants.go.
Added EX_LICENSING_API_DOMAIN to constants/constants.go.
Added RX_LICENSING_API_DOMAIN to constants/constants.go.
Tenant Capacity Data Source:
Added a new Terraform configuration example for powerplatform_tenant_capacity in examples/data-sources/powerplatform_tenant_capacity/data-source.tf.
Updated ProviderConfigUrls struct to include LicensingUrl in internal/powerplatform/config/config.go.
Imported capacity service in internal/powerplatform/provider.go.
Configured LicensingUrl for various environments in internal/powerplatform/provider.go[1][2].
Added capacity.NewTenantCapcityDataSource to the list of data sources in internal/powerplatform/provider.go.
New Capacity Service:
Implemented CapacityClient in internal/powerplatform/services/capacity/api_capacity.go.
Added TenantCapacityDataSource in internal/powerplatform/services/capacity/datasource_tenant_capacity.go.
Defined data models for capacity in internal/powerplatform/services/capacity/models_capacity.go.
This pull request includes several changes to add support for licensing API domains and new data sources for tenant information. The most important changes include updates to constants, new data source documentation, and modifications to the provider configuration and tests.
Constants Update:
constants/constants.go
: Added new constants forPUBLIC_LICENSING_API_DOMAIN
,USDOD_LICENSING_API_DOMAIN
,USGOV_LICENSING_API_DOMAIN
,USGOVHIGH_LICENSING_API_DOMAIN
,CHINA_LICENSING_API_DOMAIN
,EX_LICENSING_API_DOMAIN
, andRX_LICENSING_API_DOMAIN
. [1] [2] [3] [4] [5] [6] [7]Documentation:
docs/data-sources/tenant.md
: Added documentation for thepowerplatform_tenant
data source, which fetches the client configuration for a given tenant.docs/data-sources/tenant_capacity.md
: Added documentation for thepowerplatform_tenant_capacity
data source, which fetches the capacity information for a given tenant.Provider Configuration:
internal/powerplatform/config/config.go
: AddedLicensingUrl
toProviderConfigUrls
struct.internal/powerplatform/provider.go
: Updated theConfigure
method to setLicensingUrl
based on the environment. Added new data sources for tenant and capacity. [1] [2] [3] [4] [5]Examples:
examples/data-sources/powerplatform_tenant/data-source.tf
: Added example usage for thepowerplatform_tenant
data source.examples/data-sources/powerplatform_tenant_capacity/data-source.tf
: Added example usage for thepowerplatform_tenant_capacity
data source.Tests:
internal/powerplatform/datasource_tenant_test.go
: Added unit test for thepowerplatform_tenant
data source.internal/powerplatform/provider_test.go
: Updated imports and added tests for new data sources. [1] [2] [3]New Client:
internal/powerplatform/services/capacity/api_capacity.go
: Added a new client for handling capacity-related API calls.This pull request introduces several changes to support the new licensing API domain and adds a new data source for tenant capacity in the PowerPlatform provider.Licensing API Domain Updates:
PUBLIC_LICENSING_API_DOMAIN
toconstants/constants.go
.USDOD_LICENSING_API_DOMAIN
toconstants/constants.go
.USGOV_LICENSING_API_DOMAIN
toconstants/constants.go
.USGOVHIGH_LICENSING_API_DOMAIN
toconstants/constants.go
.CHINA_LICENSING_API_DOMAIN
toconstants/constants.go
.EX_LICENSING_API_DOMAIN
toconstants/constants.go
.RX_LICENSING_API_DOMAIN
toconstants/constants.go
.Tenant Capacity Data Source:
powerplatform_tenant_capacity
inexamples/data-sources/powerplatform_tenant_capacity/data-source.tf
.ProviderConfigUrls
struct to includeLicensingUrl
ininternal/powerplatform/config/config.go
.capacity
service ininternal/powerplatform/provider.go
.LicensingUrl
for various environments ininternal/powerplatform/provider.go
[1] [2].capacity.NewTenantCapcityDataSource
to the list of data sources ininternal/powerplatform/provider.go
.New Capacity Service:
CapacityClient
ininternal/powerplatform/services/capacity/api_capacity.go
.TenantCapacityDataSource
ininternal/powerplatform/services/capacity/datasource_tenant_capacity.go
.internal/powerplatform/services/capacity/models_capacity.go
.