зеркало из
1
0
Форкнуть 0
Co-authored-by: Harshdeep Singh <harshdsingh@microsoft.com>
Co-authored-by: Bevan Arps <bevan.arps@microsoft.com>
This commit is contained in:
Harshdeep Singh 2022-07-07 15:43:40 +12:00 коммит произвёл GitHub
Родитель edee6535ef
Коммит dadf1b08b6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
52 изменённых файлов: 48140 добавлений и 276 удалений

Просмотреть файл

@ -193,6 +193,14 @@ grouped by the originating ARM service.
|----------|--------------------|-----------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------|
| Vault | 2021-04-01-preview | v1beta20210401preview | v2.0.0-beta.1 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/keyvault/v1beta20210401preview_vault.yaml) |
## Machinelearningservices
| Resource | ARM Version | CRD Version | Supported From | Sample |
|----------------------|-------------|----------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| Workspace | 2021-07-01 | v1beta20210701 | v2.0.0-beta.2 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/machinelearningservices/v1beta20210701_workspace.yaml) |
| WorkspacesCompute | 2021-07-01 | v1beta20210701 | v2.0.0-beta.2 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/machinelearningservices/v1beta20210701_workspacescompute.yaml) |
| WorkspacesConnection | 2021-07-01 | v1beta20210701 | v2.0.0-beta.2 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/machinelearningservices/v1beta20210701_workspacesconnection.yaml) |
## Managedidentity
| Resource | ARM Version | CRD Version | Supported From | Sample |

Просмотреть файл

@ -0,0 +1,143 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/
package customizations
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning"
storage "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
"github.com/Azure/go-autorest/autorest/to"
"github.com/go-logr/logr"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"github.com/Azure/azure-service-operator/v2/internal/genericarmclient"
. "github.com/Azure/azure-service-operator/v2/internal/logging"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/extensions"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets"
)
var _ extensions.SecretsRetriever = &WorkspaceExtension{}
func (ext *WorkspaceExtension) RetrieveSecrets(
ctx context.Context,
obj genruntime.ARMMetaObject,
armClient *genericarmclient.GenericClient,
log logr.Logger) ([]*v1.Secret, error) {
// This has to be the current hub storage version. It will need to be updated
// if the hub storage version changes.
typedObj, ok := obj.(*storage.Workspace)
if !ok {
return nil, errors.Errorf("cannot run on unknown resource type %T, expected *storage.Workspace", obj)
}
// Type assert that we are the hub type. This will fail to compile if
// the hub type has been changed but this extension has not
var _ conversion.Hub = typedObj
hasSecrets := secretsSpecified(typedObj)
if !hasSecrets {
log.V(Debug).Info("No secrets retrieval to perform as operatorSpec is empty")
return nil, nil
}
id, err := genruntime.GetAndParseResourceID(obj)
if err != nil {
return nil, err
}
var keys armmachinelearning.ListWorkspaceKeysResult
// Only bother calling ListKeys if there are secrets to retrieve
if hasSecrets {
subscription := armClient.SubscriptionID()
// Using armClient.ClientOptions() here ensures we share the same HTTP connection, so this is not opening a new
// connection each time through
var workspacesClient *armmachinelearning.WorkspacesClient
workspacesClient, err = armmachinelearning.NewWorkspacesClient(subscription, armClient.Creds(), armClient.ClientOptions())
if err != nil {
return nil, errors.Wrapf(err, "failed to create new workspaceClient")
}
var resp armmachinelearning.WorkspacesClientListKeysResponse
resp, err = workspacesClient.ListKeys(ctx, id.ResourceGroupName, obj.AzureName(), nil)
if err != nil {
return nil, errors.Wrapf(err, "failed listing keys")
}
keys = resp.ListWorkspaceKeysResult
}
secretSlice, err := secretsToWrite(typedObj, keys)
if err != nil {
return nil, err
}
return secretSlice, nil
}
func secretsSpecified(obj *storage.Workspace) bool {
if obj.Spec.OperatorSpec == nil || obj.Spec.OperatorSpec.Secrets == nil {
return false
}
operatorSecrets := obj.Spec.OperatorSpec.Secrets
if operatorSecrets.AppInsightsInstrumentationKey != nil ||
operatorSecrets.PrimaryNotebookAccessKey != nil ||
operatorSecrets.SecondaryNotebookAccessKey != nil ||
operatorSecrets.UserStorageKey != nil ||
operatorSecrets.ContainerRegistryPassword != nil ||
operatorSecrets.ContainerRegistryPassword2 != nil ||
operatorSecrets.ContainerRegistryUserName != nil {
return true
}
return false
}
func secretsToWrite(obj *storage.Workspace, keysResp armmachinelearning.ListWorkspaceKeysResult) ([]*v1.Secret, error) {
operatorSpecSecrets := obj.Spec.OperatorSpec.Secrets
if operatorSpecSecrets == nil {
return nil, errors.Errorf("unexpected nil operatorspec")
}
collector := secrets.NewSecretCollector(obj.Namespace)
creds, crUsername := getContainerRegCreds(keysResp)
collector.AddSecretValue(operatorSpecSecrets.ContainerRegistryPassword, creds["password"])
collector.AddSecretValue(operatorSpecSecrets.ContainerRegistryPassword2, creds["password2"])
collector.AddSecretValue(operatorSpecSecrets.ContainerRegistryUserName, crUsername)
collector.AddSecretValue(operatorSpecSecrets.UserStorageKey, to.String(keysResp.UserStorageKey))
collector.AddSecretValue(operatorSpecSecrets.AppInsightsInstrumentationKey, to.String(keysResp.AppInsightsInstrumentationKey))
if keysResp.NotebookAccessKeys != nil {
collector.AddSecretValue(operatorSpecSecrets.PrimaryNotebookAccessKey, to.String(keysResp.NotebookAccessKeys.PrimaryAccessKey))
collector.AddSecretValue(operatorSpecSecrets.SecondaryNotebookAccessKey, to.String(keysResp.NotebookAccessKeys.SecondaryAccessKey))
}
if keysResp.ContainerRegistryCredentials != nil {
}
return collector.Secrets(), nil
}
func getContainerRegCreds(keysResp armmachinelearning.ListWorkspaceKeysResult) (map[string]string, string) {
creds := make(map[string]string)
if keysResp.ContainerRegistryCredentials == nil {
return creds, ""
}
for _, password := range keysResp.ContainerRegistryCredentials.Passwords {
if password.Name != nil && password.Value != nil {
creds[to.String(password.Name)] = to.String(password.Value)
}
}
return creds, to.String(keysResp.ContainerRegistryCredentials.Username)
}

Просмотреть файл

@ -0,0 +1,20 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package customizations
import (
v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701"
v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
)
type WorkspaceExtension struct {
}
// GetExtendedResources Returns the KubernetesResource slice for Resource versions
func (extension *WorkspaceExtension) GetExtendedResources() []genruntime.KubernetesResource {
return []genruntime.KubernetesResource{
&v20210701.Workspace{},
&v20210701s.Workspace{}}
}

Просмотреть файл

@ -0,0 +1,20 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package customizations
import (
v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701"
v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
)
type WorkspacesComputeExtension struct {
}
// GetExtendedResources Returns the KubernetesResource slice for Resource versions
func (extension *WorkspacesComputeExtension) GetExtendedResources() []genruntime.KubernetesResource {
return []genruntime.KubernetesResource{
&v20210701.WorkspacesCompute{},
&v20210701s.WorkspacesCompute{}}
}

Просмотреть файл

@ -0,0 +1,20 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package customizations
import (
v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701"
v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
)
type WorkspacesConnectionExtension struct {
}
// GetExtendedResources Returns the KubernetesResource slice for Resource versions
func (extension *WorkspacesConnectionExtension) GetExtendedResources() []genruntime.KubernetesResource {
return []genruntime.KubernetesResource{
&v20210701.WorkspacesConnection{},
&v20210701s.WorkspacesConnection{}}
}

Просмотреть файл

@ -0,0 +1,222 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
type ComputeResource_StatusARM struct {
// Id: Fully qualified resource ID for the resource. Ex -
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
Id *string `json:"id,omitempty"`
// Identity: The identity of the resource.
Identity *Identity_StatusARM `json:"identity,omitempty"`
// Location: Specifies the location of the resource.
Location *string `json:"location,omitempty"`
// Name: The name of the resource
Name *string `json:"name,omitempty"`
// Properties: Compute properties
Properties *Compute_StatusARM `json:"properties,omitempty"`
// Sku: The sku of the workspace.
Sku *Sku_StatusARM `json:"sku,omitempty"`
// SystemData: System data
SystemData *SystemData_StatusARM `json:"systemData,omitempty"`
// Tags: Contains resource tags defined as key/value pairs.
Tags map[string]string `json:"tags,omitempty"`
// Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
}
type Compute_StatusARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
// ComputeType: The type of compute
ComputeType *ComputeType_Status `json:"computeType,omitempty"`
// CreatedOn: The time at which the compute was created.
CreatedOn *string `json:"createdOn,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
// IsAttachedCompute: Indicating whether the compute was provisioned by user and brought from outside if true, or machine
// learning service provisioned it if false.
IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
// ModifiedOn: The time at which the compute was last modified.
ModifiedOn *string `json:"modifiedOn,omitempty"`
// ProvisioningErrors: Errors during provisioning
ProvisioningErrors []ErrorResponse_StatusARM `json:"provisioningErrors,omitempty"`
// ProvisioningState: The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and
// Failed.
ProvisioningState *ComputeStatusProvisioningState `json:"provisioningState,omitempty"`
// ResourceId: ARM resource id of the underlying compute
ResourceId *string `json:"resourceId,omitempty"`
}
type Identity_StatusARM struct {
// PrincipalId: The principal ID of resource identity.
PrincipalId *string `json:"principalId,omitempty"`
// TenantId: The tenant ID of resource.
TenantId *string `json:"tenantId,omitempty"`
// Type: The identity type.
Type *IdentityStatusType `json:"type,omitempty"`
// UserAssignedIdentities: The user assigned identities associated with the resource.
UserAssignedIdentities map[string]UserAssignedIdentity_StatusARM `json:"userAssignedIdentities,omitempty"`
}
type Sku_StatusARM struct {
// Name: Name of the sku
Name *string `json:"name,omitempty"`
// Tier: Tier of the sku like Basic or Enterprise
Tier *string `json:"tier,omitempty"`
}
type SystemData_StatusARM struct {
// CreatedAt: The timestamp of resource creation (UTC).
CreatedAt *string `json:"createdAt,omitempty"`
// CreatedBy: The identity that created the resource.
CreatedBy *string `json:"createdBy,omitempty"`
// CreatedByType: The type of identity that created the resource.
CreatedByType *SystemDataStatusCreatedByType `json:"createdByType,omitempty"`
// LastModifiedAt: The timestamp of resource last modification (UTC)
LastModifiedAt *string `json:"lastModifiedAt,omitempty"`
// LastModifiedBy: The identity that last modified the resource.
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
// LastModifiedByType: The type of identity that last modified the resource.
LastModifiedByType *SystemDataStatusLastModifiedByType `json:"lastModifiedByType,omitempty"`
}
type ComputeStatusProvisioningState string
const (
ComputeStatusProvisioningStateCanceled = ComputeStatusProvisioningState("Canceled")
ComputeStatusProvisioningStateCreating = ComputeStatusProvisioningState("Creating")
ComputeStatusProvisioningStateDeleting = ComputeStatusProvisioningState("Deleting")
ComputeStatusProvisioningStateFailed = ComputeStatusProvisioningState("Failed")
ComputeStatusProvisioningStateSucceeded = ComputeStatusProvisioningState("Succeeded")
ComputeStatusProvisioningStateUnknown = ComputeStatusProvisioningState("Unknown")
ComputeStatusProvisioningStateUpdating = ComputeStatusProvisioningState("Updating")
)
type ComputeType_Status string
const (
ComputeType_StatusAKS = ComputeType_Status("AKS")
ComputeType_StatusAmlCompute = ComputeType_Status("AmlCompute")
ComputeType_StatusComputeInstance = ComputeType_Status("ComputeInstance")
ComputeType_StatusDataFactory = ComputeType_Status("DataFactory")
ComputeType_StatusDataLakeAnalytics = ComputeType_Status("DataLakeAnalytics")
ComputeType_StatusDatabricks = ComputeType_Status("Databricks")
ComputeType_StatusHDInsight = ComputeType_Status("HDInsight")
ComputeType_StatusKubernetes = ComputeType_Status("Kubernetes")
ComputeType_StatusSynapseSpark = ComputeType_Status("SynapseSpark")
ComputeType_StatusVirtualMachine = ComputeType_Status("VirtualMachine")
)
type ErrorResponse_StatusARM struct {
// Error: The error object.
Error *ErrorDetail_StatusARM `json:"error,omitempty"`
}
type IdentityStatusType string
const (
IdentityStatusTypeNone = IdentityStatusType("None")
IdentityStatusTypeSystemAssigned = IdentityStatusType("SystemAssigned")
IdentityStatusTypeSystemAssignedUserAssigned = IdentityStatusType("SystemAssigned,UserAssigned")
IdentityStatusTypeUserAssigned = IdentityStatusType("UserAssigned")
)
type SystemDataStatusCreatedByType string
const (
SystemDataStatusCreatedByTypeApplication = SystemDataStatusCreatedByType("Application")
SystemDataStatusCreatedByTypeKey = SystemDataStatusCreatedByType("Key")
SystemDataStatusCreatedByTypeManagedIdentity = SystemDataStatusCreatedByType("ManagedIdentity")
SystemDataStatusCreatedByTypeUser = SystemDataStatusCreatedByType("User")
)
type SystemDataStatusLastModifiedByType string
const (
SystemDataStatusLastModifiedByTypeApplication = SystemDataStatusLastModifiedByType("Application")
SystemDataStatusLastModifiedByTypeKey = SystemDataStatusLastModifiedByType("Key")
SystemDataStatusLastModifiedByTypeManagedIdentity = SystemDataStatusLastModifiedByType("ManagedIdentity")
SystemDataStatusLastModifiedByTypeUser = SystemDataStatusLastModifiedByType("User")
)
type UserAssignedIdentity_StatusARM struct {
// ClientId: The clientId(aka appId) of the user assigned identity.
ClientId *string `json:"clientId,omitempty"`
// PrincipalId: The principal ID of the user assigned identity.
PrincipalId *string `json:"principalId,omitempty"`
// TenantId: The tenant ID of the user assigned identity.
TenantId *string `json:"tenantId,omitempty"`
}
type ErrorDetail_StatusARM struct {
// AdditionalInfo: The error additional info.
AdditionalInfo []ErrorAdditionalInfo_StatusARM `json:"additionalInfo,omitempty"`
// Code: The error code.
Code *string `json:"code,omitempty"`
// Details: The error details.
Details []ErrorDetail_Status_UnrolledARM `json:"details,omitempty"`
// Message: The error message.
Message *string `json:"message,omitempty"`
// Target: The error target.
Target *string `json:"target,omitempty"`
}
type ErrorAdditionalInfo_StatusARM struct {
// Info: The additional info.
Info map[string]v1.JSON `json:"info,omitempty"`
// Type: The additional info type.
Type *string `json:"type,omitempty"`
}
type ErrorDetail_Status_UnrolledARM struct {
// AdditionalInfo: The error additional info.
AdditionalInfo []ErrorAdditionalInfo_StatusARM `json:"additionalInfo,omitempty"`
// Code: The error code.
Code *string `json:"code,omitempty"`
// Message: The error message.
Message *string `json:"message,omitempty"`
// Target: The error target.
Target *string `json:"target,omitempty"`
}

Просмотреть файл

@ -0,0 +1,744 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_ComputeResource_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ComputeResource_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForComputeResourceStatusARM, ComputeResourceStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForComputeResourceStatusARM runs a test to see if a specific instance of ComputeResource_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForComputeResourceStatusARM(subject ComputeResource_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ComputeResource_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ComputeResource_StatusARM instances for property testing - lazily instantiated by
// ComputeResourceStatusARMGenerator()
var computeResourceStatusARMGenerator gopter.Gen
// ComputeResourceStatusARMGenerator returns a generator of ComputeResource_StatusARM instances for property testing.
// We first initialize computeResourceStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func ComputeResourceStatusARMGenerator() gopter.Gen {
if computeResourceStatusARMGenerator != nil {
return computeResourceStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForComputeResourceStatusARM(generators)
computeResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(ComputeResource_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForComputeResourceStatusARM(generators)
AddRelatedPropertyGeneratorsForComputeResourceStatusARM(generators)
computeResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(ComputeResource_StatusARM{}), generators)
return computeResourceStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForComputeResourceStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForComputeResourceStatusARM(gens map[string]gopter.Gen) {
gens["Id"] = gen.PtrOf(gen.AlphaString())
gens["Location"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.PtrOf(gen.AlphaString())
gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())
gens["Type"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForComputeResourceStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForComputeResourceStatusARM(gens map[string]gopter.Gen) {
gens["Identity"] = gen.PtrOf(IdentityStatusARMGenerator())
gens["Properties"] = gen.PtrOf(ComputeStatusARMGenerator())
gens["Sku"] = gen.PtrOf(SkuStatusARMGenerator())
gens["SystemData"] = gen.PtrOf(SystemDataStatusARMGenerator())
}
func Test_Compute_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Compute_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForComputeStatusARM, ComputeStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForComputeStatusARM runs a test to see if a specific instance of Compute_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForComputeStatusARM(subject Compute_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Compute_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Compute_StatusARM instances for property testing - lazily instantiated by ComputeStatusARMGenerator()
var computeStatusARMGenerator gopter.Gen
// ComputeStatusARMGenerator returns a generator of Compute_StatusARM instances for property testing.
// We first initialize computeStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func ComputeStatusARMGenerator() gopter.Gen {
if computeStatusARMGenerator != nil {
return computeStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForComputeStatusARM(generators)
computeStatusARMGenerator = gen.Struct(reflect.TypeOf(Compute_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForComputeStatusARM(generators)
AddRelatedPropertyGeneratorsForComputeStatusARM(generators)
computeStatusARMGenerator = gen.Struct(reflect.TypeOf(Compute_StatusARM{}), generators)
return computeStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForComputeStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForComputeStatusARM(gens map[string]gopter.Gen) {
gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(
ComputeType_StatusAKS,
ComputeType_StatusAmlCompute,
ComputeType_StatusComputeInstance,
ComputeType_StatusDataFactory,
ComputeType_StatusDataLakeAnalytics,
ComputeType_StatusDatabricks,
ComputeType_StatusHDInsight,
ComputeType_StatusKubernetes,
ComputeType_StatusSynapseSpark,
ComputeType_StatusVirtualMachine))
gens["CreatedOn"] = gen.PtrOf(gen.AlphaString())
gens["Description"] = gen.PtrOf(gen.AlphaString())
gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
gens["IsAttachedCompute"] = gen.PtrOf(gen.Bool())
gens["ModifiedOn"] = gen.PtrOf(gen.AlphaString())
gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
ComputeStatusProvisioningStateCanceled,
ComputeStatusProvisioningStateCreating,
ComputeStatusProvisioningStateDeleting,
ComputeStatusProvisioningStateFailed,
ComputeStatusProvisioningStateSucceeded,
ComputeStatusProvisioningStateUnknown,
ComputeStatusProvisioningStateUpdating))
gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForComputeStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForComputeStatusARM(gens map[string]gopter.Gen) {
gens["ProvisioningErrors"] = gen.SliceOf(ErrorResponseStatusARMGenerator())
}
func Test_Identity_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Identity_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForIdentityStatusARM, IdentityStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForIdentityStatusARM runs a test to see if a specific instance of Identity_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForIdentityStatusARM(subject Identity_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Identity_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Identity_StatusARM instances for property testing - lazily instantiated by IdentityStatusARMGenerator()
var identityStatusARMGenerator gopter.Gen
// IdentityStatusARMGenerator returns a generator of Identity_StatusARM instances for property testing.
// We first initialize identityStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func IdentityStatusARMGenerator() gopter.Gen {
if identityStatusARMGenerator != nil {
return identityStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForIdentityStatusARM(generators)
identityStatusARMGenerator = gen.Struct(reflect.TypeOf(Identity_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForIdentityStatusARM(generators)
AddRelatedPropertyGeneratorsForIdentityStatusARM(generators)
identityStatusARMGenerator = gen.Struct(reflect.TypeOf(Identity_StatusARM{}), generators)
return identityStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForIdentityStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForIdentityStatusARM(gens map[string]gopter.Gen) {
gens["PrincipalId"] = gen.PtrOf(gen.AlphaString())
gens["TenantId"] = gen.PtrOf(gen.AlphaString())
gens["Type"] = gen.PtrOf(gen.OneConstOf(
IdentityStatusTypeNone,
IdentityStatusTypeSystemAssigned,
IdentityStatusTypeSystemAssignedUserAssigned,
IdentityStatusTypeUserAssigned))
}
// AddRelatedPropertyGeneratorsForIdentityStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForIdentityStatusARM(gens map[string]gopter.Gen) {
gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentityStatusARMGenerator())
}
func Test_Sku_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Sku_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForSkuStatusARM, SkuStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForSkuStatusARM runs a test to see if a specific instance of Sku_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForSkuStatusARM(subject Sku_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Sku_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Sku_StatusARM instances for property testing - lazily instantiated by SkuStatusARMGenerator()
var skuStatusARMGenerator gopter.Gen
// SkuStatusARMGenerator returns a generator of Sku_StatusARM instances for property testing.
func SkuStatusARMGenerator() gopter.Gen {
if skuStatusARMGenerator != nil {
return skuStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForSkuStatusARM(generators)
skuStatusARMGenerator = gen.Struct(reflect.TypeOf(Sku_StatusARM{}), generators)
return skuStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForSkuStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSkuStatusARM(gens map[string]gopter.Gen) {
gens["Name"] = gen.PtrOf(gen.AlphaString())
gens["Tier"] = gen.PtrOf(gen.AlphaString())
}
func Test_SystemData_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of SystemData_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForSystemDataStatusARM, SystemDataStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForSystemDataStatusARM runs a test to see if a specific instance of SystemData_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForSystemDataStatusARM(subject SystemData_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual SystemData_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of SystemData_StatusARM instances for property testing - lazily instantiated by
// SystemDataStatusARMGenerator()
var systemDataStatusARMGenerator gopter.Gen
// SystemDataStatusARMGenerator returns a generator of SystemData_StatusARM instances for property testing.
func SystemDataStatusARMGenerator() gopter.Gen {
if systemDataStatusARMGenerator != nil {
return systemDataStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForSystemDataStatusARM(generators)
systemDataStatusARMGenerator = gen.Struct(reflect.TypeOf(SystemData_StatusARM{}), generators)
return systemDataStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForSystemDataStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSystemDataStatusARM(gens map[string]gopter.Gen) {
gens["CreatedAt"] = gen.PtrOf(gen.AlphaString())
gens["CreatedBy"] = gen.PtrOf(gen.AlphaString())
gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf(
SystemDataStatusCreatedByTypeApplication,
SystemDataStatusCreatedByTypeKey,
SystemDataStatusCreatedByTypeManagedIdentity,
SystemDataStatusCreatedByTypeUser))
gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString())
gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString())
gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf(
SystemDataStatusLastModifiedByTypeApplication,
SystemDataStatusLastModifiedByTypeKey,
SystemDataStatusLastModifiedByTypeManagedIdentity,
SystemDataStatusLastModifiedByTypeUser))
}
func Test_ErrorResponse_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ErrorResponse_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForErrorResponseStatusARM, ErrorResponseStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForErrorResponseStatusARM runs a test to see if a specific instance of ErrorResponse_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForErrorResponseStatusARM(subject ErrorResponse_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ErrorResponse_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ErrorResponse_StatusARM instances for property testing - lazily instantiated by
// ErrorResponseStatusARMGenerator()
var errorResponseStatusARMGenerator gopter.Gen
// ErrorResponseStatusARMGenerator returns a generator of ErrorResponse_StatusARM instances for property testing.
func ErrorResponseStatusARMGenerator() gopter.Gen {
if errorResponseStatusARMGenerator != nil {
return errorResponseStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddRelatedPropertyGeneratorsForErrorResponseStatusARM(generators)
errorResponseStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorResponse_StatusARM{}), generators)
return errorResponseStatusARMGenerator
}
// AddRelatedPropertyGeneratorsForErrorResponseStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForErrorResponseStatusARM(gens map[string]gopter.Gen) {
gens["Error"] = gen.PtrOf(ErrorDetailStatusARMGenerator())
}
func Test_UserAssignedIdentity_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of UserAssignedIdentity_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityStatusARM, UserAssignedIdentityStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForUserAssignedIdentityStatusARM runs a test to see if a specific instance of UserAssignedIdentity_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForUserAssignedIdentityStatusARM(subject UserAssignedIdentity_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual UserAssignedIdentity_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of UserAssignedIdentity_StatusARM instances for property testing - lazily instantiated by
// UserAssignedIdentityStatusARMGenerator()
var userAssignedIdentityStatusARMGenerator gopter.Gen
// UserAssignedIdentityStatusARMGenerator returns a generator of UserAssignedIdentity_StatusARM instances for property testing.
func UserAssignedIdentityStatusARMGenerator() gopter.Gen {
if userAssignedIdentityStatusARMGenerator != nil {
return userAssignedIdentityStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForUserAssignedIdentityStatusARM(generators)
userAssignedIdentityStatusARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_StatusARM{}), generators)
return userAssignedIdentityStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForUserAssignedIdentityStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForUserAssignedIdentityStatusARM(gens map[string]gopter.Gen) {
gens["ClientId"] = gen.PtrOf(gen.AlphaString())
gens["PrincipalId"] = gen.PtrOf(gen.AlphaString())
gens["TenantId"] = gen.PtrOf(gen.AlphaString())
}
func Test_ErrorDetail_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ErrorDetail_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForErrorDetailStatusARM, ErrorDetailStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForErrorDetailStatusARM runs a test to see if a specific instance of ErrorDetail_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForErrorDetailStatusARM(subject ErrorDetail_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ErrorDetail_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ErrorDetail_StatusARM instances for property testing - lazily instantiated by
// ErrorDetailStatusARMGenerator()
var errorDetailStatusARMGenerator gopter.Gen
// ErrorDetailStatusARMGenerator returns a generator of ErrorDetail_StatusARM instances for property testing.
// We first initialize errorDetailStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func ErrorDetailStatusARMGenerator() gopter.Gen {
if errorDetailStatusARMGenerator != nil {
return errorDetailStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForErrorDetailStatusARM(generators)
errorDetailStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForErrorDetailStatusARM(generators)
AddRelatedPropertyGeneratorsForErrorDetailStatusARM(generators)
errorDetailStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_StatusARM{}), generators)
return errorDetailStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForErrorDetailStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForErrorDetailStatusARM(gens map[string]gopter.Gen) {
gens["Code"] = gen.PtrOf(gen.AlphaString())
gens["Message"] = gen.PtrOf(gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForErrorDetailStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForErrorDetailStatusARM(gens map[string]gopter.Gen) {
gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusARMGenerator())
gens["Details"] = gen.SliceOf(ErrorDetailStatusUnrolledARMGenerator())
}
func Test_ErrorAdditionalInfo_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ErrorAdditionalInfo_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForErrorAdditionalInfoStatusARM, ErrorAdditionalInfoStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForErrorAdditionalInfoStatusARM runs a test to see if a specific instance of ErrorAdditionalInfo_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForErrorAdditionalInfoStatusARM(subject ErrorAdditionalInfo_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ErrorAdditionalInfo_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ErrorAdditionalInfo_StatusARM instances for property testing - lazily instantiated by
// ErrorAdditionalInfoStatusARMGenerator()
var errorAdditionalInfoStatusARMGenerator gopter.Gen
// ErrorAdditionalInfoStatusARMGenerator returns a generator of ErrorAdditionalInfo_StatusARM instances for property testing.
func ErrorAdditionalInfoStatusARMGenerator() gopter.Gen {
if errorAdditionalInfoStatusARMGenerator != nil {
return errorAdditionalInfoStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatusARM(generators)
errorAdditionalInfoStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorAdditionalInfo_StatusARM{}), generators)
return errorAdditionalInfoStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatusARM(gens map[string]gopter.Gen) {
gens["Type"] = gen.PtrOf(gen.AlphaString())
}
func Test_ErrorDetail_Status_UnrolledARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ErrorDetail_Status_UnrolledARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForErrorDetailStatusUnrolledARM, ErrorDetailStatusUnrolledARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForErrorDetailStatusUnrolledARM runs a test to see if a specific instance of ErrorDetail_Status_UnrolledARM round trips to JSON and back losslessly
func RunJSONSerializationTestForErrorDetailStatusUnrolledARM(subject ErrorDetail_Status_UnrolledARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ErrorDetail_Status_UnrolledARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ErrorDetail_Status_UnrolledARM instances for property testing - lazily instantiated by
// ErrorDetailStatusUnrolledARMGenerator()
var errorDetailStatusUnrolledARMGenerator gopter.Gen
// ErrorDetailStatusUnrolledARMGenerator returns a generator of ErrorDetail_Status_UnrolledARM instances for property testing.
// We first initialize errorDetailStatusUnrolledARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func ErrorDetailStatusUnrolledARMGenerator() gopter.Gen {
if errorDetailStatusUnrolledARMGenerator != nil {
return errorDetailStatusUnrolledARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM(generators)
errorDetailStatusUnrolledARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_UnrolledARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM(generators)
AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolledARM(generators)
errorDetailStatusUnrolledARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_UnrolledARM{}), generators)
return errorDetailStatusUnrolledARMGenerator
}
// AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM(gens map[string]gopter.Gen) {
gens["Code"] = gen.PtrOf(gen.AlphaString())
gens["Message"] = gen.PtrOf(gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolledARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolledARM(gens map[string]gopter.Gen) {
gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusARMGenerator())
}

Просмотреть файл

@ -0,0 +1,10 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Package v1beta20210701 contains API Schema definitions for the machinelearningservices v1beta20210701 API group
// +groupName=machinelearningservices.azure.com
package v1beta20210701

Просмотреть файл

@ -0,0 +1,31 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Package v1beta20210701 contains API Schema definitions for the machinelearningservices v1beta20210701 API group
// +kubebuilder:object:generate=true
// All object properties are optional by default, this will be overridden when needed:
// +kubebuilder:validation:Optional
// +groupName=machinelearningservices.azure.com
package v1beta20210701
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "machinelearningservices.azure.com", Version: "v1beta20210701"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
localSchemeBuilder = SchemeBuilder.SchemeBuilder
)

Просмотреть файл

@ -0,0 +1,203 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
type Workspace_StatusARM struct {
// Id: Fully qualified resource ID for the resource. Ex -
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
Id *string `json:"id,omitempty"`
// Identity: The identity of the resource.
Identity *Identity_StatusARM `json:"identity,omitempty"`
// Location: Specifies the location of the resource.
Location *string `json:"location,omitempty"`
// Name: The name of the resource
Name *string `json:"name,omitempty"`
// Properties: The properties of the machine learning workspace.
Properties *WorkspaceProperties_StatusARM `json:"properties,omitempty"`
// Sku: The sku of the workspace.
Sku *Sku_StatusARM `json:"sku,omitempty"`
// SystemData: System data
SystemData *SystemData_StatusARM `json:"systemData,omitempty"`
// Tags: Contains resource tags defined as key/value pairs.
Tags map[string]string `json:"tags,omitempty"`
// Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
}
type WorkspaceProperties_StatusARM struct {
// AllowPublicAccessWhenBehindVnet: The flag to indicate whether to allow public access when behind VNet.
AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"`
// ApplicationInsights: ARM id of the application insights associated with this workspace. This cannot be changed once the
// workspace has been created
ApplicationInsights *string `json:"applicationInsights,omitempty"`
// ContainerRegistry: ARM id of the container registry associated with this workspace. This cannot be changed once the
// workspace has been created
ContainerRegistry *string `json:"containerRegistry,omitempty"`
// Description: The description of this workspace.
Description *string `json:"description,omitempty"`
// DiscoveryUrl: Url for the discovery service to identify regional endpoints for machine learning experimentation services
DiscoveryUrl *string `json:"discoveryUrl,omitempty"`
// Encryption: The encryption settings of Azure ML workspace.
Encryption *EncryptionProperty_StatusARM `json:"encryption,omitempty"`
// FriendlyName: The friendly name for this workspace. This name in mutable
FriendlyName *string `json:"friendlyName,omitempty"`
// HbiWorkspace: The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service
HbiWorkspace *bool `json:"hbiWorkspace,omitempty"`
// ImageBuildCompute: The compute name for image build
ImageBuildCompute *string `json:"imageBuildCompute,omitempty"`
// KeyVault: ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been
// created
KeyVault *string `json:"keyVault,omitempty"`
// MlFlowTrackingUri: The URI associated with this workspace that machine learning flow must point at to set up tracking.
MlFlowTrackingUri *string `json:"mlFlowTrackingUri,omitempty"`
// NotebookInfo: The notebook info of Azure ML workspace.
NotebookInfo *NotebookResourceInfo_StatusARM `json:"notebookInfo,omitempty"`
// PrimaryUserAssignedIdentity: The user assigned identity resource id that represents the workspace identity.
PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"`
// PrivateEndpointConnections: The list of private endpoint connections in the workspace.
PrivateEndpointConnections []PrivateEndpointConnection_Status_SubResourceEmbeddedARM `json:"privateEndpointConnections,omitempty"`
// PrivateLinkCount: Count of private connections in the workspace
PrivateLinkCount *int `json:"privateLinkCount,omitempty"`
// ProvisioningState: The current deployment state of workspace resource. The provisioningState is to indicate states for
// resource provisioning.
ProvisioningState *WorkspacePropertiesStatusProvisioningState `json:"provisioningState,omitempty"`
// PublicNetworkAccess: Whether requests from Public Network are allowed.
PublicNetworkAccess *WorkspacePropertiesStatusPublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// ServiceManagedResourcesSettings: The service managed resource settings.
ServiceManagedResourcesSettings *ServiceManagedResourcesSettings_StatusARM `json:"serviceManagedResourcesSettings,omitempty"`
// ServiceProvisionedResourceGroup: The name of the managed resource group created by workspace RP in customer subscription
// if the workspace is CMK workspace
ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"`
// SharedPrivateLinkResources: The list of shared private link resources in this workspace.
SharedPrivateLinkResources []SharedPrivateLinkResource_StatusARM `json:"sharedPrivateLinkResources,omitempty"`
// StorageAccount: ARM id of the storage account associated with this workspace. This cannot be changed once the workspace
// has been created
StorageAccount *string `json:"storageAccount,omitempty"`
// StorageHnsEnabled: If the storage associated with the workspace has hierarchical namespace(HNS) enabled.
StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"`
// TenantId: The tenant id associated with this workspace.
TenantId *string `json:"tenantId,omitempty"`
// WorkspaceId: The immutable id associated with this workspace.
WorkspaceId *string `json:"workspaceId,omitempty"`
}
type EncryptionProperty_StatusARM struct {
// Identity: The identity that will be used to access the key vault for encryption at rest.
Identity *IdentityForCmk_StatusARM `json:"identity,omitempty"`
// KeyVaultProperties: Customer Key vault properties.
KeyVaultProperties *KeyVaultProperties_StatusARM `json:"keyVaultProperties,omitempty"`
// Status: Indicates whether or not the encryption is enabled for the workspace.
Status *EncryptionPropertyStatusStatus `json:"status,omitempty"`
}
type NotebookResourceInfo_StatusARM struct {
Fqdn *string `json:"fqdn,omitempty"`
// NotebookPreparationError: The error that occurs when preparing notebook.
NotebookPreparationError *NotebookPreparationError_StatusARM `json:"notebookPreparationError,omitempty"`
// ResourceId: the data plane resourceId that used to initialize notebook component
ResourceId *string `json:"resourceId,omitempty"`
}
type PrivateEndpointConnection_Status_SubResourceEmbeddedARM struct {
// Id: Fully qualified resource ID for the resource. Ex -
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
Id *string `json:"id,omitempty"`
// Identity: The identity of the resource.
Identity *Identity_StatusARM `json:"identity,omitempty"`
// Sku: The sku of the workspace.
Sku *Sku_StatusARM `json:"sku,omitempty"`
// SystemData: System data
SystemData *SystemData_StatusARM `json:"systemData,omitempty"`
}
type ServiceManagedResourcesSettings_StatusARM struct {
// CosmosDb: The settings for the service managed cosmosdb account.
CosmosDb *CosmosDbSettings_StatusARM `json:"cosmosDb,omitempty"`
}
type SharedPrivateLinkResource_StatusARM struct {
// Name: Unique name of the private link.
Name *string `json:"name,omitempty"`
// Properties: Resource properties.
Properties *SharedPrivateLinkResourceProperty_StatusARM `json:"properties,omitempty"`
}
type CosmosDbSettings_StatusARM struct {
// CollectionsThroughput: The throughput of the collections in cosmosdb database
CollectionsThroughput *int `json:"collectionsThroughput,omitempty"`
}
type IdentityForCmk_StatusARM struct {
// UserAssignedIdentity: The ArmId of the user assigned identity that will be used to access the customer managed key vault
UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}
type KeyVaultProperties_StatusARM struct {
// IdentityClientId: For future use - The client id of the identity which will be used to access key vault.
IdentityClientId *string `json:"identityClientId,omitempty"`
// KeyIdentifier: Key vault uri to access the encryption key.
KeyIdentifier *string `json:"keyIdentifier,omitempty"`
// KeyVaultArmId: The ArmId of the keyVault where the customer owned encryption key is present.
KeyVaultArmId *string `json:"keyVaultArmId,omitempty"`
}
type NotebookPreparationError_StatusARM struct {
ErrorMessage *string `json:"errorMessage,omitempty"`
StatusCode *int `json:"statusCode,omitempty"`
}
type SharedPrivateLinkResourceProperty_StatusARM struct {
// GroupId: The private link resource group id.
GroupId *string `json:"groupId,omitempty"`
// PrivateLinkResourceId: The resource id that private link links to.
PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"`
// RequestMessage: Request message.
RequestMessage *string `json:"requestMessage,omitempty"`
// Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
Status *PrivateEndpointServiceConnectionStatus_Status `json:"status,omitempty"`
}

Просмотреть файл

@ -0,0 +1,872 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_Workspace_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Workspace_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspaceStatusARM, WorkspaceStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspaceStatusARM runs a test to see if a specific instance of Workspace_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspaceStatusARM(subject Workspace_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Workspace_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Workspace_StatusARM instances for property testing - lazily instantiated by WorkspaceStatusARMGenerator()
var workspaceStatusARMGenerator gopter.Gen
// WorkspaceStatusARMGenerator returns a generator of Workspace_StatusARM instances for property testing.
// We first initialize workspaceStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspaceStatusARMGenerator() gopter.Gen {
if workspaceStatusARMGenerator != nil {
return workspaceStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceStatusARM(generators)
workspaceStatusARMGenerator = gen.Struct(reflect.TypeOf(Workspace_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceStatusARM(generators)
AddRelatedPropertyGeneratorsForWorkspaceStatusARM(generators)
workspaceStatusARMGenerator = gen.Struct(reflect.TypeOf(Workspace_StatusARM{}), generators)
return workspaceStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspaceStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspaceStatusARM(gens map[string]gopter.Gen) {
gens["Id"] = gen.PtrOf(gen.AlphaString())
gens["Location"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.PtrOf(gen.AlphaString())
gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())
gens["Type"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspaceStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspaceStatusARM(gens map[string]gopter.Gen) {
gens["Identity"] = gen.PtrOf(IdentityStatusARMGenerator())
gens["Properties"] = gen.PtrOf(WorkspacePropertiesStatusARMGenerator())
gens["Sku"] = gen.PtrOf(SkuStatusARMGenerator())
gens["SystemData"] = gen.PtrOf(SystemDataStatusARMGenerator())
}
func Test_WorkspaceProperties_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspaceProperties_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacePropertiesStatusARM, WorkspacePropertiesStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacePropertiesStatusARM runs a test to see if a specific instance of WorkspaceProperties_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacePropertiesStatusARM(subject WorkspaceProperties_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspaceProperties_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspaceProperties_StatusARM instances for property testing - lazily instantiated by
// WorkspacePropertiesStatusARMGenerator()
var workspacePropertiesStatusARMGenerator gopter.Gen
// WorkspacePropertiesStatusARMGenerator returns a generator of WorkspaceProperties_StatusARM instances for property testing.
// We first initialize workspacePropertiesStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspacePropertiesStatusARMGenerator() gopter.Gen {
if workspacePropertiesStatusARMGenerator != nil {
return workspacePropertiesStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM(generators)
workspacePropertiesStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM(generators)
AddRelatedPropertyGeneratorsForWorkspacePropertiesStatusARM(generators)
workspacePropertiesStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties_StatusARM{}), generators)
return workspacePropertiesStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM(gens map[string]gopter.Gen) {
gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool())
gens["ApplicationInsights"] = gen.PtrOf(gen.AlphaString())
gens["ContainerRegistry"] = gen.PtrOf(gen.AlphaString())
gens["Description"] = gen.PtrOf(gen.AlphaString())
gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString())
gens["FriendlyName"] = gen.PtrOf(gen.AlphaString())
gens["HbiWorkspace"] = gen.PtrOf(gen.Bool())
gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString())
gens["KeyVault"] = gen.PtrOf(gen.AlphaString())
gens["MlFlowTrackingUri"] = gen.PtrOf(gen.AlphaString())
gens["PrimaryUserAssignedIdentity"] = gen.PtrOf(gen.AlphaString())
gens["PrivateLinkCount"] = gen.PtrOf(gen.Int())
gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
WorkspacePropertiesStatusProvisioningStateCanceled,
WorkspacePropertiesStatusProvisioningStateCreating,
WorkspacePropertiesStatusProvisioningStateDeleting,
WorkspacePropertiesStatusProvisioningStateFailed,
WorkspacePropertiesStatusProvisioningStateSucceeded,
WorkspacePropertiesStatusProvisioningStateUnknown,
WorkspacePropertiesStatusProvisioningStateUpdating))
gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(WorkspacePropertiesStatusPublicNetworkAccessDisabled, WorkspacePropertiesStatusPublicNetworkAccessEnabled))
gens["ServiceProvisionedResourceGroup"] = gen.PtrOf(gen.AlphaString())
gens["StorageAccount"] = gen.PtrOf(gen.AlphaString())
gens["StorageHnsEnabled"] = gen.PtrOf(gen.Bool())
gens["TenantId"] = gen.PtrOf(gen.AlphaString())
gens["WorkspaceId"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspacePropertiesStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacePropertiesStatusARM(gens map[string]gopter.Gen) {
gens["Encryption"] = gen.PtrOf(EncryptionPropertyStatusARMGenerator())
gens["NotebookInfo"] = gen.PtrOf(NotebookResourceInfoStatusARMGenerator())
gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator())
gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsStatusARMGenerator())
gens["SharedPrivateLinkResources"] = gen.SliceOf(SharedPrivateLinkResourceStatusARMGenerator())
}
func Test_EncryptionProperty_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of EncryptionProperty_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForEncryptionPropertyStatusARM, EncryptionPropertyStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForEncryptionPropertyStatusARM runs a test to see if a specific instance of EncryptionProperty_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForEncryptionPropertyStatusARM(subject EncryptionProperty_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual EncryptionProperty_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of EncryptionProperty_StatusARM instances for property testing - lazily instantiated by
// EncryptionPropertyStatusARMGenerator()
var encryptionPropertyStatusARMGenerator gopter.Gen
// EncryptionPropertyStatusARMGenerator returns a generator of EncryptionProperty_StatusARM instances for property testing.
// We first initialize encryptionPropertyStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func EncryptionPropertyStatusARMGenerator() gopter.Gen {
if encryptionPropertyStatusARMGenerator != nil {
return encryptionPropertyStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM(generators)
encryptionPropertyStatusARMGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM(generators)
AddRelatedPropertyGeneratorsForEncryptionPropertyStatusARM(generators)
encryptionPropertyStatusARMGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_StatusARM{}), generators)
return encryptionPropertyStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM(gens map[string]gopter.Gen) {
gens["Status"] = gen.PtrOf(gen.OneConstOf(EncryptionPropertyStatusStatusDisabled, EncryptionPropertyStatusStatusEnabled))
}
// AddRelatedPropertyGeneratorsForEncryptionPropertyStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForEncryptionPropertyStatusARM(gens map[string]gopter.Gen) {
gens["Identity"] = gen.PtrOf(IdentityForCmkStatusARMGenerator())
gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesStatusARMGenerator())
}
func Test_NotebookResourceInfo_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of NotebookResourceInfo_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForNotebookResourceInfoStatusARM, NotebookResourceInfoStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForNotebookResourceInfoStatusARM runs a test to see if a specific instance of NotebookResourceInfo_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForNotebookResourceInfoStatusARM(subject NotebookResourceInfo_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual NotebookResourceInfo_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of NotebookResourceInfo_StatusARM instances for property testing - lazily instantiated by
// NotebookResourceInfoStatusARMGenerator()
var notebookResourceInfoStatusARMGenerator gopter.Gen
// NotebookResourceInfoStatusARMGenerator returns a generator of NotebookResourceInfo_StatusARM instances for property testing.
// We first initialize notebookResourceInfoStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func NotebookResourceInfoStatusARMGenerator() gopter.Gen {
if notebookResourceInfoStatusARMGenerator != nil {
return notebookResourceInfoStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM(generators)
notebookResourceInfoStatusARMGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM(generators)
AddRelatedPropertyGeneratorsForNotebookResourceInfoStatusARM(generators)
notebookResourceInfoStatusARMGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_StatusARM{}), generators)
return notebookResourceInfoStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM(gens map[string]gopter.Gen) {
gens["Fqdn"] = gen.PtrOf(gen.AlphaString())
gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForNotebookResourceInfoStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForNotebookResourceInfoStatusARM(gens map[string]gopter.Gen) {
gens["NotebookPreparationError"] = gen.PtrOf(NotebookPreparationErrorStatusARMGenerator())
}
func Test_PrivateEndpointConnection_Status_SubResourceEmbeddedARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of PrivateEndpointConnection_Status_SubResourceEmbeddedARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbeddedARM, PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbeddedARM runs a test to see if a specific instance of PrivateEndpointConnection_Status_SubResourceEmbeddedARM round trips to JSON and back losslessly
func RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(subject PrivateEndpointConnection_Status_SubResourceEmbeddedARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual PrivateEndpointConnection_Status_SubResourceEmbeddedARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of PrivateEndpointConnection_Status_SubResourceEmbeddedARM instances for property testing - lazily
// instantiated by PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator()
var privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator gopter.Gen
// PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator returns a generator of PrivateEndpointConnection_Status_SubResourceEmbeddedARM instances for property testing.
// We first initialize privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator() gopter.Gen {
if privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator != nil {
return privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(generators)
privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbeddedARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(generators)
AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(generators)
privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbeddedARM{}), generators)
return privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator
}
// AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(gens map[string]gopter.Gen) {
gens["Id"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(gens map[string]gopter.Gen) {
gens["Identity"] = gen.PtrOf(IdentityStatusARMGenerator())
gens["Sku"] = gen.PtrOf(SkuStatusARMGenerator())
gens["SystemData"] = gen.PtrOf(SystemDataStatusARMGenerator())
}
func Test_ServiceManagedResourcesSettings_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ServiceManagedResourcesSettings_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettingsStatusARM, ServiceManagedResourcesSettingsStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForServiceManagedResourcesSettingsStatusARM runs a test to see if a specific instance of ServiceManagedResourcesSettings_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForServiceManagedResourcesSettingsStatusARM(subject ServiceManagedResourcesSettings_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ServiceManagedResourcesSettings_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ServiceManagedResourcesSettings_StatusARM instances for property testing - lazily instantiated by
// ServiceManagedResourcesSettingsStatusARMGenerator()
var serviceManagedResourcesSettingsStatusARMGenerator gopter.Gen
// ServiceManagedResourcesSettingsStatusARMGenerator returns a generator of ServiceManagedResourcesSettings_StatusARM instances for property testing.
func ServiceManagedResourcesSettingsStatusARMGenerator() gopter.Gen {
if serviceManagedResourcesSettingsStatusARMGenerator != nil {
return serviceManagedResourcesSettingsStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatusARM(generators)
serviceManagedResourcesSettingsStatusARMGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings_StatusARM{}), generators)
return serviceManagedResourcesSettingsStatusARMGenerator
}
// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatusARM(gens map[string]gopter.Gen) {
gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsStatusARMGenerator())
}
func Test_SharedPrivateLinkResource_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of SharedPrivateLinkResource_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourceStatusARM, SharedPrivateLinkResourceStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForSharedPrivateLinkResourceStatusARM runs a test to see if a specific instance of SharedPrivateLinkResource_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForSharedPrivateLinkResourceStatusARM(subject SharedPrivateLinkResource_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual SharedPrivateLinkResource_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of SharedPrivateLinkResource_StatusARM instances for property testing - lazily instantiated by
// SharedPrivateLinkResourceStatusARMGenerator()
var sharedPrivateLinkResourceStatusARMGenerator gopter.Gen
// SharedPrivateLinkResourceStatusARMGenerator returns a generator of SharedPrivateLinkResource_StatusARM instances for property testing.
// We first initialize sharedPrivateLinkResourceStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func SharedPrivateLinkResourceStatusARMGenerator() gopter.Gen {
if sharedPrivateLinkResourceStatusARMGenerator != nil {
return sharedPrivateLinkResourceStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(generators)
sharedPrivateLinkResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResource_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(generators)
AddRelatedPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(generators)
sharedPrivateLinkResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResource_StatusARM{}), generators)
return sharedPrivateLinkResourceStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(gens map[string]gopter.Gen) {
gens["Name"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForSharedPrivateLinkResourceStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(gens map[string]gopter.Gen) {
gens["Properties"] = gen.PtrOf(SharedPrivateLinkResourcePropertyStatusARMGenerator())
}
func Test_CosmosDbSettings_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of CosmosDbSettings_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForCosmosDbSettingsStatusARM, CosmosDbSettingsStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForCosmosDbSettingsStatusARM runs a test to see if a specific instance of CosmosDbSettings_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForCosmosDbSettingsStatusARM(subject CosmosDbSettings_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual CosmosDbSettings_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of CosmosDbSettings_StatusARM instances for property testing - lazily instantiated by
// CosmosDbSettingsStatusARMGenerator()
var cosmosDbSettingsStatusARMGenerator gopter.Gen
// CosmosDbSettingsStatusARMGenerator returns a generator of CosmosDbSettings_StatusARM instances for property testing.
func CosmosDbSettingsStatusARMGenerator() gopter.Gen {
if cosmosDbSettingsStatusARMGenerator != nil {
return cosmosDbSettingsStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForCosmosDbSettingsStatusARM(generators)
cosmosDbSettingsStatusARMGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings_StatusARM{}), generators)
return cosmosDbSettingsStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForCosmosDbSettingsStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForCosmosDbSettingsStatusARM(gens map[string]gopter.Gen) {
gens["CollectionsThroughput"] = gen.PtrOf(gen.Int())
}
func Test_IdentityForCmk_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of IdentityForCmk_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForIdentityForCmkStatusARM, IdentityForCmkStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForIdentityForCmkStatusARM runs a test to see if a specific instance of IdentityForCmk_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForIdentityForCmkStatusARM(subject IdentityForCmk_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual IdentityForCmk_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of IdentityForCmk_StatusARM instances for property testing - lazily instantiated by
// IdentityForCmkStatusARMGenerator()
var identityForCmkStatusARMGenerator gopter.Gen
// IdentityForCmkStatusARMGenerator returns a generator of IdentityForCmk_StatusARM instances for property testing.
func IdentityForCmkStatusARMGenerator() gopter.Gen {
if identityForCmkStatusARMGenerator != nil {
return identityForCmkStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForIdentityForCmkStatusARM(generators)
identityForCmkStatusARMGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk_StatusARM{}), generators)
return identityForCmkStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForIdentityForCmkStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForIdentityForCmkStatusARM(gens map[string]gopter.Gen) {
gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString())
}
func Test_KeyVaultProperties_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of KeyVaultProperties_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForKeyVaultPropertiesStatusARM, KeyVaultPropertiesStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForKeyVaultPropertiesStatusARM runs a test to see if a specific instance of KeyVaultProperties_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForKeyVaultPropertiesStatusARM(subject KeyVaultProperties_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual KeyVaultProperties_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of KeyVaultProperties_StatusARM instances for property testing - lazily instantiated by
// KeyVaultPropertiesStatusARMGenerator()
var keyVaultPropertiesStatusARMGenerator gopter.Gen
// KeyVaultPropertiesStatusARMGenerator returns a generator of KeyVaultProperties_StatusARM instances for property testing.
func KeyVaultPropertiesStatusARMGenerator() gopter.Gen {
if keyVaultPropertiesStatusARMGenerator != nil {
return keyVaultPropertiesStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatusARM(generators)
keyVaultPropertiesStatusARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_StatusARM{}), generators)
return keyVaultPropertiesStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatusARM(gens map[string]gopter.Gen) {
gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString())
gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString())
gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString())
}
func Test_NotebookPreparationError_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of NotebookPreparationError_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForNotebookPreparationErrorStatusARM, NotebookPreparationErrorStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForNotebookPreparationErrorStatusARM runs a test to see if a specific instance of NotebookPreparationError_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForNotebookPreparationErrorStatusARM(subject NotebookPreparationError_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual NotebookPreparationError_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of NotebookPreparationError_StatusARM instances for property testing - lazily instantiated by
// NotebookPreparationErrorStatusARMGenerator()
var notebookPreparationErrorStatusARMGenerator gopter.Gen
// NotebookPreparationErrorStatusARMGenerator returns a generator of NotebookPreparationError_StatusARM instances for property testing.
func NotebookPreparationErrorStatusARMGenerator() gopter.Gen {
if notebookPreparationErrorStatusARMGenerator != nil {
return notebookPreparationErrorStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatusARM(generators)
notebookPreparationErrorStatusARMGenerator = gen.Struct(reflect.TypeOf(NotebookPreparationError_StatusARM{}), generators)
return notebookPreparationErrorStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatusARM(gens map[string]gopter.Gen) {
gens["ErrorMessage"] = gen.PtrOf(gen.AlphaString())
gens["StatusCode"] = gen.PtrOf(gen.Int())
}
func Test_SharedPrivateLinkResourceProperty_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of SharedPrivateLinkResourceProperty_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourcePropertyStatusARM, SharedPrivateLinkResourcePropertyStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForSharedPrivateLinkResourcePropertyStatusARM runs a test to see if a specific instance of SharedPrivateLinkResourceProperty_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForSharedPrivateLinkResourcePropertyStatusARM(subject SharedPrivateLinkResourceProperty_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual SharedPrivateLinkResourceProperty_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of SharedPrivateLinkResourceProperty_StatusARM instances for property testing - lazily instantiated by
// SharedPrivateLinkResourcePropertyStatusARMGenerator()
var sharedPrivateLinkResourcePropertyStatusARMGenerator gopter.Gen
// SharedPrivateLinkResourcePropertyStatusARMGenerator returns a generator of SharedPrivateLinkResourceProperty_StatusARM instances for property testing.
func SharedPrivateLinkResourcePropertyStatusARMGenerator() gopter.Gen {
if sharedPrivateLinkResourcePropertyStatusARMGenerator != nil {
return sharedPrivateLinkResourcePropertyStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyStatusARM(generators)
sharedPrivateLinkResourcePropertyStatusARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResourceProperty_StatusARM{}), generators)
return sharedPrivateLinkResourcePropertyStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyStatusARM(gens map[string]gopter.Gen) {
gens["GroupId"] = gen.PtrOf(gen.AlphaString())
gens["PrivateLinkResourceId"] = gen.PtrOf(gen.AlphaString())
gens["RequestMessage"] = gen.PtrOf(gen.AlphaString())
gens["Status"] = gen.PtrOf(gen.OneConstOf(
PrivateEndpointServiceConnectionStatus_StatusApproved,
PrivateEndpointServiceConnectionStatus_StatusDisconnected,
PrivateEndpointServiceConnectionStatus_StatusPending,
PrivateEndpointServiceConnectionStatus_StatusRejected,
PrivateEndpointServiceConnectionStatus_StatusTimeout))
}

Просмотреть файл

@ -0,0 +1,39 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
type WorkspaceConnection_StatusARM struct {
// Id: ResourceId of the workspace connection.
Id *string `json:"id,omitempty"`
// Name: Friendly name of the workspace connection.
Name *string `json:"name,omitempty"`
// Properties: Properties of workspace connection.
Properties *WorkspaceConnectionProps_StatusARM `json:"properties,omitempty"`
// Type: Resource type of workspace connection.
Type *string `json:"type,omitempty"`
}
type WorkspaceConnectionProps_StatusARM struct {
// AuthType: Authorization type of the workspace connection.
AuthType *string `json:"authType,omitempty"`
// Category: Category of the workspace connection.
Category *string `json:"category,omitempty"`
// Target: Target of the workspace connection.
Target *string `json:"target,omitempty"`
// Value: Value details of the workspace connection.
Value *string `json:"value,omitempty"`
// ValueFormat: format for the workspace connection value
ValueFormat *WorkspaceConnectionPropsStatusValueFormat `json:"valueFormat,omitempty"`
}
type WorkspaceConnectionPropsStatusValueFormat string
const WorkspaceConnectionPropsStatusValueFormatJSON = WorkspaceConnectionPropsStatusValueFormat("JSON")

Просмотреть файл

@ -0,0 +1,158 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_WorkspaceConnection_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspaceConnection_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionStatusARM, WorkspaceConnectionStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspaceConnectionStatusARM runs a test to see if a specific instance of WorkspaceConnection_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspaceConnectionStatusARM(subject WorkspaceConnection_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspaceConnection_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspaceConnection_StatusARM instances for property testing - lazily instantiated by
// WorkspaceConnectionStatusARMGenerator()
var workspaceConnectionStatusARMGenerator gopter.Gen
// WorkspaceConnectionStatusARMGenerator returns a generator of WorkspaceConnection_StatusARM instances for property testing.
// We first initialize workspaceConnectionStatusARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspaceConnectionStatusARMGenerator() gopter.Gen {
if workspaceConnectionStatusARMGenerator != nil {
return workspaceConnectionStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM(generators)
workspaceConnectionStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_StatusARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM(generators)
AddRelatedPropertyGeneratorsForWorkspaceConnectionStatusARM(generators)
workspaceConnectionStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_StatusARM{}), generators)
return workspaceConnectionStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM(gens map[string]gopter.Gen) {
gens["Id"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.PtrOf(gen.AlphaString())
gens["Type"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspaceConnectionStatusARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspaceConnectionStatusARM(gens map[string]gopter.Gen) {
gens["Properties"] = gen.PtrOf(WorkspaceConnectionPropsStatusARMGenerator())
}
func Test_WorkspaceConnectionProps_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspaceConnectionProps_StatusARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionPropsStatusARM, WorkspaceConnectionPropsStatusARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspaceConnectionPropsStatusARM runs a test to see if a specific instance of WorkspaceConnectionProps_StatusARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspaceConnectionPropsStatusARM(subject WorkspaceConnectionProps_StatusARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspaceConnectionProps_StatusARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspaceConnectionProps_StatusARM instances for property testing - lazily instantiated by
// WorkspaceConnectionPropsStatusARMGenerator()
var workspaceConnectionPropsStatusARMGenerator gopter.Gen
// WorkspaceConnectionPropsStatusARMGenerator returns a generator of WorkspaceConnectionProps_StatusARM instances for property testing.
func WorkspaceConnectionPropsStatusARMGenerator() gopter.Gen {
if workspaceConnectionPropsStatusARMGenerator != nil {
return workspaceConnectionPropsStatusARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsStatusARM(generators)
workspaceConnectionPropsStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnectionProps_StatusARM{}), generators)
return workspaceConnectionPropsStatusARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsStatusARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsStatusARM(gens map[string]gopter.Gen) {
gens["AuthType"] = gen.PtrOf(gen.AlphaString())
gens["Category"] = gen.PtrOf(gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
gens["Value"] = gen.PtrOf(gen.AlphaString())
gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsStatusValueFormatJSON))
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,139 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import "github.com/Azure/azure-service-operator/v2/pkg/genruntime"
type Workspaces_SpecARM struct {
// Identity: Identity for the resource.
Identity *IdentityARM `json:"identity,omitempty"`
// Location: Specifies the location of the resource.
Location *string `json:"location,omitempty"`
// Name: Name of Azure Machine Learning workspace.
Name string `json:"name,omitempty"`
// Properties: The properties of a machine learning workspace.
Properties *Workspaces_Spec_PropertiesARM `json:"properties,omitempty"`
// Sku: Sku of the resource
Sku *SkuARM `json:"sku,omitempty"`
// SystemData: Metadata pertaining to creation and last modification of the resource.
SystemData *SystemDataARM `json:"systemData,omitempty"`
// Tags: Contains resource tags defined as key/value pairs.
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ARMResourceSpec = &Workspaces_SpecARM{}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (workspaces Workspaces_SpecARM) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetName returns the Name of the resource
func (workspaces *Workspaces_SpecARM) GetName() string {
return workspaces.Name
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces"
func (workspaces *Workspaces_SpecARM) GetType() string {
return "Microsoft.MachineLearningServices/workspaces"
}
type Workspaces_Spec_PropertiesARM struct {
// AllowPublicAccessWhenBehindVnet: The flag to indicate whether to allow public access when behind VNet.
AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"`
ApplicationInsights *string `json:"applicationInsights,omitempty"`
ContainerRegistry *string `json:"containerRegistry,omitempty"`
// Description: The description of this workspace.
Description *string `json:"description,omitempty"`
// DiscoveryUrl: Url for the discovery service to identify regional endpoints for machine learning experimentation services
DiscoveryUrl *string `json:"discoveryUrl,omitempty"`
Encryption *EncryptionPropertyARM `json:"encryption,omitempty"`
// FriendlyName: The friendly name for this workspace. This name in mutable
FriendlyName *string `json:"friendlyName,omitempty"`
// HbiWorkspace: The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service
HbiWorkspace *bool `json:"hbiWorkspace,omitempty"`
// ImageBuildCompute: The compute name for image build
ImageBuildCompute *string `json:"imageBuildCompute,omitempty"`
KeyVault *string `json:"keyVault,omitempty"`
PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"`
// PublicNetworkAccess: Whether requests from Public Network are allowed.
PublicNetworkAccess *WorkspacesSpecPropertiesPublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
ServiceManagedResourcesSettings *ServiceManagedResourcesSettingsARM `json:"serviceManagedResourcesSettings,omitempty"`
// SharedPrivateLinkResources: The list of shared private link resources in this workspace.
SharedPrivateLinkResources []Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM `json:"sharedPrivateLinkResources,omitempty"`
StorageAccount *string `json:"storageAccount,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/EncryptionProperty
type EncryptionPropertyARM struct {
// Identity: Identity that will be used to access key vault for encryption at rest
Identity *IdentityForCmkARM `json:"identity,omitempty"`
KeyVaultProperties *KeyVaultPropertiesARM `json:"keyVaultProperties,omitempty"`
// Status: Indicates whether or not the encryption is enabled for the workspace.
Status *EncryptionPropertyStatus `json:"status,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ServiceManagedResourcesSettings
type ServiceManagedResourcesSettingsARM struct {
CosmosDb *CosmosDbSettingsARM `json:"cosmosDb,omitempty"`
}
type Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM struct {
// Name: Unique name of the private link.
Name *string `json:"name,omitempty"`
// Properties: Properties of a shared private link resource.
Properties *SharedPrivateLinkResourcePropertyARM `json:"properties,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/CosmosDbSettings
type CosmosDbSettingsARM struct {
// CollectionsThroughput: The throughput of the collections in cosmosdb database
CollectionsThroughput *int `json:"collectionsThroughput,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/IdentityForCmk
type IdentityForCmkARM struct {
// UserAssignedIdentity: The ArmId of the user assigned identity that will be used to access the customer managed key vault
UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/KeyVaultProperties
type KeyVaultPropertiesARM struct {
// IdentityClientId: For future use - The client id of the identity which will be used to access key vault.
IdentityClientId *string `json:"identityClientId,omitempty"`
// KeyIdentifier: Key vault uri to access the encryption key.
KeyIdentifier *string `json:"keyIdentifier,omitempty"`
// KeyVaultArmId: The ArmId of the keyVault where the customer owned encryption key is present.
KeyVaultArmId *string `json:"keyVaultArmId,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SharedPrivateLinkResourceProperty
type SharedPrivateLinkResourcePropertyARM struct {
// GroupId: The private link resource group id.
GroupId *string `json:"groupId,omitempty"`
PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"`
// RequestMessage: Request message.
RequestMessage *string `json:"requestMessage,omitempty"`
// Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
Status *SharedPrivateLinkResourcePropertyStatus `json:"status,omitempty"`
}

Просмотреть файл

@ -0,0 +1,641 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_Workspaces_SpecARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Workspaces_SpecARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesSpecARM, WorkspacesSpecARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesSpecARM runs a test to see if a specific instance of Workspaces_SpecARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesSpecARM(subject Workspaces_SpecARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Workspaces_SpecARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Workspaces_SpecARM instances for property testing - lazily instantiated by WorkspacesSpecARMGenerator()
var workspacesSpecARMGenerator gopter.Gen
// WorkspacesSpecARMGenerator returns a generator of Workspaces_SpecARM instances for property testing.
// We first initialize workspacesSpecARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspacesSpecARMGenerator() gopter.Gen {
if workspacesSpecARMGenerator != nil {
return workspacesSpecARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesSpecARM(generators)
workspacesSpecARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_SpecARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesSpecARM(generators)
AddRelatedPropertyGeneratorsForWorkspacesSpecARM(generators)
workspacesSpecARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_SpecARM{}), generators)
return workspacesSpecARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacesSpecARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacesSpecARM(gens map[string]gopter.Gen) {
gens["Location"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.AlphaString()
gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspacesSpecARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesSpecARM(gens map[string]gopter.Gen) {
gens["Identity"] = gen.PtrOf(IdentityARMGenerator())
gens["Properties"] = gen.PtrOf(WorkspacesSpecPropertiesARMGenerator())
gens["Sku"] = gen.PtrOf(SkuARMGenerator())
gens["SystemData"] = gen.PtrOf(SystemDataARMGenerator())
}
func Test_Workspaces_Spec_PropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Workspaces_Spec_PropertiesARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesSpecPropertiesARM, WorkspacesSpecPropertiesARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesSpecPropertiesARM runs a test to see if a specific instance of Workspaces_Spec_PropertiesARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesSpecPropertiesARM(subject Workspaces_Spec_PropertiesARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Workspaces_Spec_PropertiesARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Workspaces_Spec_PropertiesARM instances for property testing - lazily instantiated by
// WorkspacesSpecPropertiesARMGenerator()
var workspacesSpecPropertiesARMGenerator gopter.Gen
// WorkspacesSpecPropertiesARMGenerator returns a generator of Workspaces_Spec_PropertiesARM instances for property testing.
// We first initialize workspacesSpecPropertiesARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspacesSpecPropertiesARMGenerator() gopter.Gen {
if workspacesSpecPropertiesARMGenerator != nil {
return workspacesSpecPropertiesARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM(generators)
workspacesSpecPropertiesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_PropertiesARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM(generators)
AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesARM(generators)
workspacesSpecPropertiesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_PropertiesARM{}), generators)
return workspacesSpecPropertiesARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM(gens map[string]gopter.Gen) {
gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool())
gens["ApplicationInsights"] = gen.PtrOf(gen.AlphaString())
gens["ContainerRegistry"] = gen.PtrOf(gen.AlphaString())
gens["Description"] = gen.PtrOf(gen.AlphaString())
gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString())
gens["FriendlyName"] = gen.PtrOf(gen.AlphaString())
gens["HbiWorkspace"] = gen.PtrOf(gen.Bool())
gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString())
gens["KeyVault"] = gen.PtrOf(gen.AlphaString())
gens["PrimaryUserAssignedIdentity"] = gen.PtrOf(gen.AlphaString())
gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(WorkspacesSpecPropertiesPublicNetworkAccessDisabled, WorkspacesSpecPropertiesPublicNetworkAccessEnabled))
gens["StorageAccount"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesARM(gens map[string]gopter.Gen) {
gens["Encryption"] = gen.PtrOf(EncryptionPropertyARMGenerator())
gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsARMGenerator())
gens["SharedPrivateLinkResources"] = gen.SliceOf(WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator())
}
func Test_EncryptionPropertyARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of EncryptionPropertyARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForEncryptionPropertyARM, EncryptionPropertyARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForEncryptionPropertyARM runs a test to see if a specific instance of EncryptionPropertyARM round trips to JSON and back losslessly
func RunJSONSerializationTestForEncryptionPropertyARM(subject EncryptionPropertyARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual EncryptionPropertyARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of EncryptionPropertyARM instances for property testing - lazily instantiated by
// EncryptionPropertyARMGenerator()
var encryptionPropertyARMGenerator gopter.Gen
// EncryptionPropertyARMGenerator returns a generator of EncryptionPropertyARM instances for property testing.
// We first initialize encryptionPropertyARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func EncryptionPropertyARMGenerator() gopter.Gen {
if encryptionPropertyARMGenerator != nil {
return encryptionPropertyARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForEncryptionPropertyARM(generators)
encryptionPropertyARMGenerator = gen.Struct(reflect.TypeOf(EncryptionPropertyARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForEncryptionPropertyARM(generators)
AddRelatedPropertyGeneratorsForEncryptionPropertyARM(generators)
encryptionPropertyARMGenerator = gen.Struct(reflect.TypeOf(EncryptionPropertyARM{}), generators)
return encryptionPropertyARMGenerator
}
// AddIndependentPropertyGeneratorsForEncryptionPropertyARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForEncryptionPropertyARM(gens map[string]gopter.Gen) {
gens["Status"] = gen.PtrOf(gen.OneConstOf(EncryptionPropertyStatusDisabled, EncryptionPropertyStatusEnabled))
}
// AddRelatedPropertyGeneratorsForEncryptionPropertyARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForEncryptionPropertyARM(gens map[string]gopter.Gen) {
gens["Identity"] = gen.PtrOf(IdentityForCmkARMGenerator())
gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesARMGenerator())
}
func Test_ServiceManagedResourcesSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of ServiceManagedResourcesSettingsARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettingsARM, ServiceManagedResourcesSettingsARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForServiceManagedResourcesSettingsARM runs a test to see if a specific instance of ServiceManagedResourcesSettingsARM round trips to JSON and back losslessly
func RunJSONSerializationTestForServiceManagedResourcesSettingsARM(subject ServiceManagedResourcesSettingsARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual ServiceManagedResourcesSettingsARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of ServiceManagedResourcesSettingsARM instances for property testing - lazily instantiated by
// ServiceManagedResourcesSettingsARMGenerator()
var serviceManagedResourcesSettingsARMGenerator gopter.Gen
// ServiceManagedResourcesSettingsARMGenerator returns a generator of ServiceManagedResourcesSettingsARM instances for property testing.
func ServiceManagedResourcesSettingsARMGenerator() gopter.Gen {
if serviceManagedResourcesSettingsARMGenerator != nil {
return serviceManagedResourcesSettingsARMGenerator
}
generators := make(map[string]gopter.Gen)
AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsARM(generators)
serviceManagedResourcesSettingsARMGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettingsARM{}), generators)
return serviceManagedResourcesSettingsARMGenerator
}
// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsARM(gens map[string]gopter.Gen) {
gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsARMGenerator())
}
func Test_Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM, WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM runs a test to see if a specific instance of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(subject Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM instances for property testing - lazily
// instantiated by WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator()
var workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator gopter.Gen
// WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator returns a generator of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM instances for property testing.
// We first initialize workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator() gopter.Gen {
if workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator != nil {
return workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(generators)
workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(generators)
AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(generators)
workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM{}), generators)
return workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(gens map[string]gopter.Gen) {
gens["Name"] = gen.PtrOf(gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(gens map[string]gopter.Gen) {
gens["Properties"] = gen.PtrOf(SharedPrivateLinkResourcePropertyARMGenerator())
}
func Test_CosmosDbSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of CosmosDbSettingsARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForCosmosDbSettingsARM, CosmosDbSettingsARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForCosmosDbSettingsARM runs a test to see if a specific instance of CosmosDbSettingsARM round trips to JSON and back losslessly
func RunJSONSerializationTestForCosmosDbSettingsARM(subject CosmosDbSettingsARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual CosmosDbSettingsARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of CosmosDbSettingsARM instances for property testing - lazily instantiated by
// CosmosDbSettingsARMGenerator()
var cosmosDbSettingsARMGenerator gopter.Gen
// CosmosDbSettingsARMGenerator returns a generator of CosmosDbSettingsARM instances for property testing.
func CosmosDbSettingsARMGenerator() gopter.Gen {
if cosmosDbSettingsARMGenerator != nil {
return cosmosDbSettingsARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForCosmosDbSettingsARM(generators)
cosmosDbSettingsARMGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettingsARM{}), generators)
return cosmosDbSettingsARMGenerator
}
// AddIndependentPropertyGeneratorsForCosmosDbSettingsARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForCosmosDbSettingsARM(gens map[string]gopter.Gen) {
gens["CollectionsThroughput"] = gen.PtrOf(gen.Int())
}
func Test_IdentityForCmkARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of IdentityForCmkARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForIdentityForCmkARM, IdentityForCmkARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForIdentityForCmkARM runs a test to see if a specific instance of IdentityForCmkARM round trips to JSON and back losslessly
func RunJSONSerializationTestForIdentityForCmkARM(subject IdentityForCmkARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual IdentityForCmkARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of IdentityForCmkARM instances for property testing - lazily instantiated by IdentityForCmkARMGenerator()
var identityForCmkARMGenerator gopter.Gen
// IdentityForCmkARMGenerator returns a generator of IdentityForCmkARM instances for property testing.
func IdentityForCmkARMGenerator() gopter.Gen {
if identityForCmkARMGenerator != nil {
return identityForCmkARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForIdentityForCmkARM(generators)
identityForCmkARMGenerator = gen.Struct(reflect.TypeOf(IdentityForCmkARM{}), generators)
return identityForCmkARMGenerator
}
// AddIndependentPropertyGeneratorsForIdentityForCmkARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForIdentityForCmkARM(gens map[string]gopter.Gen) {
gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString())
}
func Test_KeyVaultPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of KeyVaultPropertiesARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForKeyVaultPropertiesARM, KeyVaultPropertiesARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForKeyVaultPropertiesARM runs a test to see if a specific instance of KeyVaultPropertiesARM round trips to JSON and back losslessly
func RunJSONSerializationTestForKeyVaultPropertiesARM(subject KeyVaultPropertiesARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual KeyVaultPropertiesARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of KeyVaultPropertiesARM instances for property testing - lazily instantiated by
// KeyVaultPropertiesARMGenerator()
var keyVaultPropertiesARMGenerator gopter.Gen
// KeyVaultPropertiesARMGenerator returns a generator of KeyVaultPropertiesARM instances for property testing.
func KeyVaultPropertiesARMGenerator() gopter.Gen {
if keyVaultPropertiesARMGenerator != nil {
return keyVaultPropertiesARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForKeyVaultPropertiesARM(generators)
keyVaultPropertiesARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultPropertiesARM{}), generators)
return keyVaultPropertiesARMGenerator
}
// AddIndependentPropertyGeneratorsForKeyVaultPropertiesARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForKeyVaultPropertiesARM(gens map[string]gopter.Gen) {
gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString())
gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString())
gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString())
}
func Test_SharedPrivateLinkResourcePropertyARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of SharedPrivateLinkResourcePropertyARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourcePropertyARM, SharedPrivateLinkResourcePropertyARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForSharedPrivateLinkResourcePropertyARM runs a test to see if a specific instance of SharedPrivateLinkResourcePropertyARM round trips to JSON and back losslessly
func RunJSONSerializationTestForSharedPrivateLinkResourcePropertyARM(subject SharedPrivateLinkResourcePropertyARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual SharedPrivateLinkResourcePropertyARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of SharedPrivateLinkResourcePropertyARM instances for property testing - lazily instantiated by
// SharedPrivateLinkResourcePropertyARMGenerator()
var sharedPrivateLinkResourcePropertyARMGenerator gopter.Gen
// SharedPrivateLinkResourcePropertyARMGenerator returns a generator of SharedPrivateLinkResourcePropertyARM instances for property testing.
func SharedPrivateLinkResourcePropertyARMGenerator() gopter.Gen {
if sharedPrivateLinkResourcePropertyARMGenerator != nil {
return sharedPrivateLinkResourcePropertyARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyARM(generators)
sharedPrivateLinkResourcePropertyARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResourcePropertyARM{}), generators)
return sharedPrivateLinkResourcePropertyARMGenerator
}
// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyARM(gens map[string]gopter.Gen) {
gens["GroupId"] = gen.PtrOf(gen.AlphaString())
gens["PrivateLinkResourceId"] = gen.PtrOf(gen.AlphaString())
gens["RequestMessage"] = gen.PtrOf(gen.AlphaString())
gens["Status"] = gen.PtrOf(gen.OneConstOf(
SharedPrivateLinkResourcePropertyStatusApproved,
SharedPrivateLinkResourcePropertyStatusDisconnected,
SharedPrivateLinkResourcePropertyStatusPending,
SharedPrivateLinkResourcePropertyStatusRejected,
SharedPrivateLinkResourcePropertyStatusTimeout))
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,817 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
type WorkspacesComputes_SpecARM struct {
// Identity: Identity for the resource.
Identity *IdentityARM `json:"identity,omitempty"`
// Location: Specifies the location of the resource.
Location *string `json:"location,omitempty"`
// Name: Name of the Azure Machine Learning compute.
Name string `json:"name,omitempty"`
// Properties: Machine Learning compute object.
Properties *ComputeARM `json:"properties,omitempty"`
// Sku: Sku of the resource
Sku *SkuARM `json:"sku,omitempty"`
// SystemData: Metadata pertaining to creation and last modification of the resource.
SystemData *SystemDataARM `json:"systemData,omitempty"`
// Tags: Contains resource tags defined as key/value pairs.
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ARMResourceSpec = &WorkspacesComputes_SpecARM{}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (computes WorkspacesComputes_SpecARM) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetName returns the Name of the resource
func (computes *WorkspacesComputes_SpecARM) GetName() string {
return computes.Name
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/computes"
func (computes *WorkspacesComputes_SpecARM) GetType() string {
return "Microsoft.MachineLearningServices/workspaces/computes"
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Compute
type ComputeARM struct {
// AKS: Mutually exclusive with all other properties
AKS *Compute_AKSARM `json:"aks,omitempty"`
// AmlCompute: Mutually exclusive with all other properties
AmlCompute *Compute_AmlComputeARM `json:"amlCompute,omitempty"`
// ComputeInstance: Mutually exclusive with all other properties
ComputeInstance *Compute_ComputeInstanceARM `json:"computeInstance,omitempty"`
// DataFactory: Mutually exclusive with all other properties
DataFactory *Compute_DataFactoryARM `json:"dataFactory,omitempty"`
// DataLakeAnalytics: Mutually exclusive with all other properties
DataLakeAnalytics *Compute_DataLakeAnalyticsARM `json:"dataLakeAnalytics,omitempty"`
// Databricks: Mutually exclusive with all other properties
Databricks *Compute_DatabricksARM `json:"databricks,omitempty"`
// HDInsight: Mutually exclusive with all other properties
HDInsight *Compute_HDInsightARM `json:"hdInsight,omitempty"`
// SynapseSpark: Mutually exclusive with all other properties
SynapseSpark *Compute_SynapseSparkARM `json:"synapseSpark,omitempty"`
// VirtualMachine: Mutually exclusive with all other properties
VirtualMachine *Compute_VirtualMachineARM `json:"virtualMachine,omitempty"`
}
// MarshalJSON defers JSON marshaling to the first non-nil property, because ComputeARM represents a discriminated union (JSON OneOf)
func (compute ComputeARM) MarshalJSON() ([]byte, error) {
if compute.AKS != nil {
return json.Marshal(compute.AKS)
}
if compute.AmlCompute != nil {
return json.Marshal(compute.AmlCompute)
}
if compute.ComputeInstance != nil {
return json.Marshal(compute.ComputeInstance)
}
if compute.DataFactory != nil {
return json.Marshal(compute.DataFactory)
}
if compute.DataLakeAnalytics != nil {
return json.Marshal(compute.DataLakeAnalytics)
}
if compute.Databricks != nil {
return json.Marshal(compute.Databricks)
}
if compute.HDInsight != nil {
return json.Marshal(compute.HDInsight)
}
if compute.SynapseSpark != nil {
return json.Marshal(compute.SynapseSpark)
}
if compute.VirtualMachine != nil {
return json.Marshal(compute.VirtualMachine)
}
return nil, nil
}
// UnmarshalJSON unmarshals the ComputeARM
func (compute *ComputeARM) UnmarshalJSON(data []byte) error {
var rawJson map[string]interface{}
err := json.Unmarshal(data, &rawJson)
if err != nil {
return err
}
discriminator := rawJson["computeType"]
if discriminator == "AKS" {
compute.AKS = &Compute_AKSARM{}
return json.Unmarshal(data, compute.AKS)
}
if discriminator == "AmlCompute" {
compute.AmlCompute = &Compute_AmlComputeARM{}
return json.Unmarshal(data, compute.AmlCompute)
}
if discriminator == "ComputeInstance" {
compute.ComputeInstance = &Compute_ComputeInstanceARM{}
return json.Unmarshal(data, compute.ComputeInstance)
}
if discriminator == "DataFactory" {
compute.DataFactory = &Compute_DataFactoryARM{}
return json.Unmarshal(data, compute.DataFactory)
}
if discriminator == "DataLakeAnalytics" {
compute.DataLakeAnalytics = &Compute_DataLakeAnalyticsARM{}
return json.Unmarshal(data, compute.DataLakeAnalytics)
}
if discriminator == "Databricks" {
compute.Databricks = &Compute_DatabricksARM{}
return json.Unmarshal(data, compute.Databricks)
}
if discriminator == "HDInsight" {
compute.HDInsight = &Compute_HDInsightARM{}
return json.Unmarshal(data, compute.HDInsight)
}
if discriminator == "SynapseSpark" {
compute.SynapseSpark = &Compute_SynapseSparkARM{}
return json.Unmarshal(data, compute.SynapseSpark)
}
if discriminator == "VirtualMachine" {
compute.VirtualMachine = &Compute_VirtualMachineARM{}
return json.Unmarshal(data, compute.VirtualMachine)
}
// No error
return nil
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Identity
type IdentityARM struct {
// Type: The identity type.
Type *IdentityType `json:"type,omitempty"`
// UserAssignedIdentities: dictionary containing all the user assigned identities, with resourceId of the UAI as key.
UserAssignedIdentities map[string]v1.JSON `json:"userAssignedIdentities,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Sku
type SkuARM struct {
// Name: Name of the sku
Name *string `json:"name,omitempty"`
// Tier: Tier of the sku like Basic or Enterprise
Tier *string `json:"tier,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SystemData
type SystemDataARM struct {
// CreatedAt: The timestamp of resource creation (UTC).
CreatedAt *string `json:"createdAt,omitempty"`
// CreatedBy: The identity that created the resource.
CreatedBy *string `json:"createdBy,omitempty"`
// CreatedByType: The type of identity that created the resource.
CreatedByType *SystemDataCreatedByType `json:"createdByType,omitempty"`
// LastModifiedAt: The timestamp of resource last modification (UTC)
LastModifiedAt *string `json:"lastModifiedAt,omitempty"`
// LastModifiedBy: The identity that last modified the resource.
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
// LastModifiedByType: The type of identity that last modified the resource.
LastModifiedByType *SystemDataLastModifiedByType `json:"lastModifiedByType,omitempty"`
}
type Compute_AKSARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeAKSComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
// Properties: AKS properties
Properties *AKSPropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_AmlComputeARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeAmlComputeComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
// Properties: AML Compute properties
Properties *AmlComputePropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_ComputeInstanceARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeComputeInstanceComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
// Properties: Compute Instance properties
Properties *ComputeInstancePropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_DataFactoryARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeDataFactoryComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_DataLakeAnalyticsARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeDataLakeAnalyticsComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *DataLakeAnalyticsPropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_DatabricksARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeDatabricksComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
// Properties: Properties of Databricks
Properties *DatabricksPropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_HDInsightARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeHDInsightComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
// Properties: HDInsight compute properties
Properties *HDInsightPropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_SynapseSparkARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeSynapseSparkComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *SynapseSparkPropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
type Compute_VirtualMachineARM struct {
// ComputeLocation: Location for the underlying compute
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType ComputeVirtualMachineComputeType `json:"computeType,omitempty"`
// Description: The description of the Machine Learning compute.
Description *string `json:"description,omitempty"`
// DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for
// authentication.
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *VirtualMachinePropertiesARM `json:"properties,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned,UserAssigned","UserAssigned"}
type IdentityType string
const (
IdentityTypeNone = IdentityType("None")
IdentityTypeSystemAssigned = IdentityType("SystemAssigned")
IdentityTypeSystemAssignedUserAssigned = IdentityType("SystemAssigned,UserAssigned")
IdentityTypeUserAssigned = IdentityType("UserAssigned")
)
// +kubebuilder:validation:Enum={"Application","Key","ManagedIdentity","User"}
type SystemDataCreatedByType string
const (
SystemDataCreatedByTypeApplication = SystemDataCreatedByType("Application")
SystemDataCreatedByTypeKey = SystemDataCreatedByType("Key")
SystemDataCreatedByTypeManagedIdentity = SystemDataCreatedByType("ManagedIdentity")
SystemDataCreatedByTypeUser = SystemDataCreatedByType("User")
)
// +kubebuilder:validation:Enum={"Application","Key","ManagedIdentity","User"}
type SystemDataLastModifiedByType string
const (
SystemDataLastModifiedByTypeApplication = SystemDataLastModifiedByType("Application")
SystemDataLastModifiedByTypeKey = SystemDataLastModifiedByType("Key")
SystemDataLastModifiedByTypeManagedIdentity = SystemDataLastModifiedByType("ManagedIdentity")
SystemDataLastModifiedByTypeUser = SystemDataLastModifiedByType("User")
)
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AKSProperties
type AKSPropertiesARM struct {
// AgentCount: Number of agents
AgentCount *int `json:"agentCount,omitempty"`
// AgentVmSize: Agent virtual machine size
AgentVmSize *string `json:"agentVmSize,omitempty"`
// AksNetworkingConfiguration: Advance configuration for AKS networking
AksNetworkingConfiguration *AksNetworkingConfigurationARM `json:"aksNetworkingConfiguration,omitempty"`
// ClusterFqdn: Cluster full qualified domain name
ClusterFqdn *string `json:"clusterFqdn,omitempty"`
// ClusterPurpose: Intended usage of the cluster.
ClusterPurpose *AKSPropertiesClusterPurpose `json:"clusterPurpose,omitempty"`
// LoadBalancerSubnet: Load Balancer Subnet
LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"`
// LoadBalancerType: Load Balancer Type.
LoadBalancerType *AKSPropertiesLoadBalancerType `json:"loadBalancerType,omitempty"`
// SslConfiguration: The ssl configuration for scoring
SslConfiguration *SslConfigurationARM `json:"sslConfiguration,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AmlComputeProperties
type AmlComputePropertiesARM struct {
// EnableNodePublicIp: Enable or disable node public IP address provisioning. Possible values are: Possible values are:
// true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will
// have a private endpoint and no public IPs.
EnableNodePublicIp *bool `json:"enableNodePublicIp,omitempty"`
// IsolatedNetwork: Network is isolated or not
IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"`
// OsType: Compute OS Type.
OsType *AmlComputePropertiesOsType `json:"osType,omitempty"`
// RemoteLoginPortPublicAccess: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh
// port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the
// cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined,
// else is open all public nodes. It can be default only during cluster creation time, after creation it will be either
// enabled or disabled.
RemoteLoginPortPublicAccess *AmlComputePropertiesRemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"`
// ScaleSettings: scale settings for AML Compute
ScaleSettings *ScaleSettingsARM `json:"scaleSettings,omitempty"`
// Subnet: Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
Subnet *ResourceIdARM `json:"subnet,omitempty"`
// UserAccountCredentials: Settings for user account that gets created on each on the nodes of a compute.
UserAccountCredentials *UserAccountCredentialsARM `json:"userAccountCredentials,omitempty"`
// VirtualMachineImage: Virtual Machine image for Windows AML Compute
VirtualMachineImage *VirtualMachineImageARM `json:"virtualMachineImage,omitempty"`
// VmPriority: Virtual Machine priority.
VmPriority *AmlComputePropertiesVmPriority `json:"vmPriority,omitempty"`
// VmSize: Virtual Machine Size
VmSize *string `json:"vmSize,omitempty"`
}
// +kubebuilder:validation:Enum={"AKS"}
type ComputeAKSComputeType string
const ComputeAKSComputeTypeAKS = ComputeAKSComputeType("AKS")
// +kubebuilder:validation:Enum={"AmlCompute"}
type ComputeAmlComputeComputeType string
const ComputeAmlComputeComputeTypeAmlCompute = ComputeAmlComputeComputeType("AmlCompute")
// +kubebuilder:validation:Enum={"ComputeInstance"}
type ComputeComputeInstanceComputeType string
const ComputeComputeInstanceComputeTypeComputeInstance = ComputeComputeInstanceComputeType("ComputeInstance")
// +kubebuilder:validation:Enum={"DataFactory"}
type ComputeDataFactoryComputeType string
const ComputeDataFactoryComputeTypeDataFactory = ComputeDataFactoryComputeType("DataFactory")
// +kubebuilder:validation:Enum={"DataLakeAnalytics"}
type ComputeDataLakeAnalyticsComputeType string
const ComputeDataLakeAnalyticsComputeTypeDataLakeAnalytics = ComputeDataLakeAnalyticsComputeType("DataLakeAnalytics")
// +kubebuilder:validation:Enum={"Databricks"}
type ComputeDatabricksComputeType string
const ComputeDatabricksComputeTypeDatabricks = ComputeDatabricksComputeType("Databricks")
// +kubebuilder:validation:Enum={"HDInsight"}
type ComputeHDInsightComputeType string
const ComputeHDInsightComputeTypeHDInsight = ComputeHDInsightComputeType("HDInsight")
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceProperties
type ComputeInstancePropertiesARM struct {
// ApplicationSharingPolicy: Policy for sharing applications on this compute instance among users of parent workspace. If
// Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access
// applications on this instance depending on his/her assigned role.
ApplicationSharingPolicy *ComputeInstancePropertiesApplicationSharingPolicy `json:"applicationSharingPolicy,omitempty"`
// ComputeInstanceAuthorizationType: The Compute Instance Authorization type. Available values are personal (default).
ComputeInstanceAuthorizationType *ComputeInstancePropertiesComputeInstanceAuthorizationType `json:"computeInstanceAuthorizationType,omitempty"`
// PersonalComputeInstanceSettings: Settings for a personal compute instance.
PersonalComputeInstanceSettings *PersonalComputeInstanceSettingsARM `json:"personalComputeInstanceSettings,omitempty"`
// SetupScripts: Details of customized scripts to execute for setting up the cluster.
SetupScripts *SetupScriptsARM `json:"setupScripts,omitempty"`
// SshSettings: Specifies policy and settings for SSH access.
SshSettings *ComputeInstanceSshSettingsARM `json:"sshSettings,omitempty"`
// Subnet: Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
Subnet *ResourceIdARM `json:"subnet,omitempty"`
// VmSize: Virtual Machine Size
VmSize *string `json:"vmSize,omitempty"`
}
// +kubebuilder:validation:Enum={"SynapseSpark"}
type ComputeSynapseSparkComputeType string
const ComputeSynapseSparkComputeTypeSynapseSpark = ComputeSynapseSparkComputeType("SynapseSpark")
// +kubebuilder:validation:Enum={"VirtualMachine"}
type ComputeVirtualMachineComputeType string
const ComputeVirtualMachineComputeTypeVirtualMachine = ComputeVirtualMachineComputeType("VirtualMachine")
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DataLakeAnalyticsProperties
type DataLakeAnalyticsPropertiesARM struct {
// DataLakeStoreAccountName: DataLake Store Account Name
DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DatabricksProperties
type DatabricksPropertiesARM struct {
// DatabricksAccessToken: Databricks access token
DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"`
// WorkspaceUrl: Workspace Url
WorkspaceUrl *string `json:"workspaceUrl,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/HDInsightProperties
type HDInsightPropertiesARM struct {
// Address: Public IP address of the master node of the cluster.
Address *string `json:"address,omitempty"`
// AdministratorAccount: Admin credentials for virtual machine
AdministratorAccount *VirtualMachineSshCredentialsARM `json:"administratorAccount,omitempty"`
// SshPort: Port open for ssh connections on the master node of the cluster.
SshPort *int `json:"sshPort,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SynapseSparkProperties
type SynapseSparkPropertiesARM struct {
// AutoPauseProperties: Auto pause properties
AutoPauseProperties *AutoPausePropertiesARM `json:"autoPauseProperties,omitempty"`
// AutoScaleProperties: Auto scale properties
AutoScaleProperties *AutoScalePropertiesARM `json:"autoScaleProperties,omitempty"`
// NodeCount: The number of compute nodes currently assigned to the compute.
NodeCount *int `json:"nodeCount,omitempty"`
// NodeSize: Node size.
NodeSize *string `json:"nodeSize,omitempty"`
// NodeSizeFamily: Node size family.
NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"`
// PoolName: Pool name.
PoolName *string `json:"poolName,omitempty"`
// ResourceGroup: Name of the resource group in which workspace is located.
ResourceGroup *string `json:"resourceGroup,omitempty"`
// SparkVersion: Spark version.
SparkVersion *string `json:"sparkVersion,omitempty"`
// SubscriptionId: Azure subscription identifier.
SubscriptionId *string `json:"subscriptionId,omitempty"`
// WorkspaceName: Name of Azure Machine Learning workspace.
WorkspaceName *string `json:"workspaceName,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineProperties
type VirtualMachinePropertiesARM struct {
// Address: Public IP address of the virtual machine.
Address *string `json:"address,omitempty"`
// AdministratorAccount: Admin credentials for virtual machine
AdministratorAccount *VirtualMachineSshCredentialsARM `json:"administratorAccount,omitempty"`
// IsNotebookInstanceCompute: Indicates whether this compute will be used for running notebooks.
IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"`
// SshPort: Port open for ssh connections.
SshPort *int `json:"sshPort,omitempty"`
// VirtualMachineSize: Virtual Machine size
VirtualMachineSize *string `json:"virtualMachineSize,omitempty"`
}
// +kubebuilder:validation:Enum={"DenseProd","DevTest","FastProd"}
type AKSPropertiesClusterPurpose string
const (
AKSPropertiesClusterPurposeDenseProd = AKSPropertiesClusterPurpose("DenseProd")
AKSPropertiesClusterPurposeDevTest = AKSPropertiesClusterPurpose("DevTest")
AKSPropertiesClusterPurposeFastProd = AKSPropertiesClusterPurpose("FastProd")
)
// +kubebuilder:validation:Enum={"InternalLoadBalancer","PublicIp"}
type AKSPropertiesLoadBalancerType string
const (
AKSPropertiesLoadBalancerTypeInternalLoadBalancer = AKSPropertiesLoadBalancerType("InternalLoadBalancer")
AKSPropertiesLoadBalancerTypePublicIp = AKSPropertiesLoadBalancerType("PublicIp")
)
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AksNetworkingConfiguration
type AksNetworkingConfigurationARM struct {
// DnsServiceIP: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address
// range specified in serviceCidr.
DnsServiceIP *string `json:"dnsServiceIP,omitempty"`
// DockerBridgeCidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP
// ranges or the Kubernetes service address range.
DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"`
// ServiceCidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP
// ranges.
ServiceCidr *string `json:"serviceCidr,omitempty"`
SubnetId *string `json:"subnetId,omitempty"`
}
// +kubebuilder:validation:Enum={"Linux","Windows"}
type AmlComputePropertiesOsType string
const (
AmlComputePropertiesOsTypeLinux = AmlComputePropertiesOsType("Linux")
AmlComputePropertiesOsTypeWindows = AmlComputePropertiesOsType("Windows")
)
// +kubebuilder:validation:Enum={"Disabled","Enabled","NotSpecified"}
type AmlComputePropertiesRemoteLoginPortPublicAccess string
const (
AmlComputePropertiesRemoteLoginPortPublicAccessDisabled = AmlComputePropertiesRemoteLoginPortPublicAccess("Disabled")
AmlComputePropertiesRemoteLoginPortPublicAccessEnabled = AmlComputePropertiesRemoteLoginPortPublicAccess("Enabled")
AmlComputePropertiesRemoteLoginPortPublicAccessNotSpecified = AmlComputePropertiesRemoteLoginPortPublicAccess("NotSpecified")
)
// +kubebuilder:validation:Enum={"Dedicated","LowPriority"}
type AmlComputePropertiesVmPriority string
const (
AmlComputePropertiesVmPriorityDedicated = AmlComputePropertiesVmPriority("Dedicated")
AmlComputePropertiesVmPriorityLowPriority = AmlComputePropertiesVmPriority("LowPriority")
)
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoPauseProperties
type AutoPausePropertiesARM struct {
DelayInMinutes *int `json:"delayInMinutes,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoScaleProperties
type AutoScalePropertiesARM struct {
Enabled *bool `json:"enabled,omitempty"`
MaxNodeCount *int `json:"maxNodeCount,omitempty"`
MinNodeCount *int `json:"minNodeCount,omitempty"`
}
// +kubebuilder:validation:Enum={"Personal","Shared"}
type ComputeInstancePropertiesApplicationSharingPolicy string
const (
ComputeInstancePropertiesApplicationSharingPolicyPersonal = ComputeInstancePropertiesApplicationSharingPolicy("Personal")
ComputeInstancePropertiesApplicationSharingPolicyShared = ComputeInstancePropertiesApplicationSharingPolicy("Shared")
)
// +kubebuilder:validation:Enum={"personal"}
type ComputeInstancePropertiesComputeInstanceAuthorizationType string
const ComputeInstancePropertiesComputeInstanceAuthorizationTypePersonal = ComputeInstancePropertiesComputeInstanceAuthorizationType("personal")
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceSshSettings
type ComputeInstanceSshSettingsARM struct {
// AdminPublicKey: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH
// key pairs.
AdminPublicKey *string `json:"adminPublicKey,omitempty"`
// SshPublicAccess: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is
// closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the
// VNet/subnet policy if applicable.
SshPublicAccess *ComputeInstanceSshSettingsSshPublicAccess `json:"sshPublicAccess,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/PersonalComputeInstanceSettings
type PersonalComputeInstanceSettingsARM struct {
// AssignedUser: A user that can be assigned to a compute instance.
AssignedUser *AssignedUserARM `json:"assignedUser,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ResourceId
type ResourceIdARM struct {
Id *string `json:"id,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScaleSettings
type ScaleSettingsARM struct {
// MaxNodeCount: Max number of nodes to use
MaxNodeCount *int `json:"maxNodeCount,omitempty"`
// MinNodeCount: Min number of nodes to use
MinNodeCount *int `json:"minNodeCount,omitempty"`
// NodeIdleTimeBeforeScaleDown: Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format.
NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SetupScripts
type SetupScriptsARM struct {
// Scripts: Customized setup scripts
Scripts *ScriptsToExecuteARM `json:"scripts,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SslConfiguration
type SslConfigurationARM struct {
// Cert: Cert data
Cert *string `json:"cert,omitempty"`
// Cname: CNAME of the cert
Cname *string `json:"cname,omitempty"`
// Key: Key data
Key *string `json:"key,omitempty"`
// LeafDomainLabel: Leaf domain label of public endpoint
LeafDomainLabel *string `json:"leafDomainLabel,omitempty"`
// OverwriteExistingDomain: Indicates whether to overwrite existing domain label.
OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"`
// Status: Enable or disable ssl for scoring.
Status *SslConfigurationStatus `json:"status,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/UserAccountCredentials
type UserAccountCredentialsARM struct {
// AdminUserName: Name of the administrator user account which can be used to SSH to nodes.
AdminUserName *string `json:"adminUserName,omitempty"`
// AdminUserPassword: Password of the administrator user account.
AdminUserPassword *string `json:"adminUserPassword,omitempty"`
// AdminUserSshPublicKey: SSH public key of the administrator user account.
AdminUserSshPublicKey *string `json:"adminUserSshPublicKey,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineImage
type VirtualMachineImageARM struct {
Id *string `json:"id,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineSshCredentials
type VirtualMachineSshCredentialsARM struct {
// Password: Password of admin account
Password *string `json:"password,omitempty"`
// PrivateKeyData: Private key data
PrivateKeyData *string `json:"privateKeyData,omitempty"`
// PublicKeyData: Public key data
PublicKeyData *string `json:"publicKeyData,omitempty"`
// Username: Username of admin account
Username *string `json:"username,omitempty"`
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AssignedUser
type AssignedUserARM struct {
// ObjectId: Users AAD Object Id.
ObjectId *string `json:"objectId,omitempty"`
// TenantId: Users AAD Tenant Id.
TenantId *string `json:"tenantId,omitempty"`
}
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type ComputeInstanceSshSettingsSshPublicAccess string
const (
ComputeInstanceSshSettingsSshPublicAccessDisabled = ComputeInstanceSshSettingsSshPublicAccess("Disabled")
ComputeInstanceSshSettingsSshPublicAccessEnabled = ComputeInstanceSshSettingsSshPublicAccess("Enabled")
)
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptsToExecute
type ScriptsToExecuteARM struct {
// CreationScript: Script reference
CreationScript *ScriptReferenceARM `json:"creationScript,omitempty"`
// StartupScript: Script reference
StartupScript *ScriptReferenceARM `json:"startupScript,omitempty"`
}
// +kubebuilder:validation:Enum={"Auto","Disabled","Enabled"}
type SslConfigurationStatus string
const (
SslConfigurationStatusAuto = SslConfigurationStatus("Auto")
SslConfigurationStatusDisabled = SslConfigurationStatus("Disabled")
SslConfigurationStatusEnabled = SslConfigurationStatus("Enabled")
)
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptReference
type ScriptReferenceARM struct {
// ScriptArguments: Optional command line arguments passed to the script to run.
ScriptArguments *string `json:"scriptArguments,omitempty"`
// ScriptData: The location of scripts in the mounted volume.
ScriptData *string `json:"scriptData,omitempty"`
// ScriptSource: The storage source of the script: inline, workspace.
ScriptSource *string `json:"scriptSource,omitempty"`
// Timeout: Optional time period passed to timeout command.
Timeout *string `json:"timeout,omitempty"`
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,909 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"fmt"
v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
"github.com/Azure/azure-service-operator/v2/internal/reflecthelpers"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
kerrors "k8s.io/apimachinery/pkg/util/errors"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections
type WorkspacesConnection struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkspacesConnections_Spec `json:"spec,omitempty"`
Status WorkspaceConnection_Status `json:"status,omitempty"`
}
var _ conditions.Conditioner = &WorkspacesConnection{}
// GetConditions returns the conditions of the resource
func (connection *WorkspacesConnection) GetConditions() conditions.Conditions {
return connection.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (connection *WorkspacesConnection) SetConditions(conditions conditions.Conditions) {
connection.Status.Conditions = conditions
}
var _ conversion.Convertible = &WorkspacesConnection{}
// ConvertFrom populates our WorkspacesConnection from the provided hub WorkspacesConnection
func (connection *WorkspacesConnection) ConvertFrom(hub conversion.Hub) error {
source, ok := hub.(*v20210701s.WorkspacesConnection)
if !ok {
return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/WorkspacesConnection but received %T instead", hub)
}
return connection.AssignPropertiesFromWorkspacesConnection(source)
}
// ConvertTo populates the provided hub WorkspacesConnection from our WorkspacesConnection
func (connection *WorkspacesConnection) ConvertTo(hub conversion.Hub) error {
destination, ok := hub.(*v20210701s.WorkspacesConnection)
if !ok {
return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/WorkspacesConnection but received %T instead", hub)
}
return connection.AssignPropertiesToWorkspacesConnection(destination)
}
// +kubebuilder:webhook:path=/mutate-machinelearningservices-azure-com-v1beta20210701-workspacesconnection,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspacesconnections,verbs=create;update,versions=v1beta20210701,name=default.v1beta20210701.workspacesconnections.machinelearningservices.azure.com,admissionReviewVersions=v1beta1
var _ admission.Defaulter = &WorkspacesConnection{}
// Default applies defaults to the WorkspacesConnection resource
func (connection *WorkspacesConnection) Default() {
connection.defaultImpl()
var temp interface{} = connection
if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {
runtimeDefaulter.CustomDefault()
}
}
// defaultAzureName defaults the Azure name of the resource to the Kubernetes name
func (connection *WorkspacesConnection) defaultAzureName() {
if connection.Spec.AzureName == "" {
connection.Spec.AzureName = connection.Name
}
}
// defaultImpl applies the code generated defaults to the WorkspacesConnection resource
func (connection *WorkspacesConnection) defaultImpl() { connection.defaultAzureName() }
var _ genruntime.KubernetesResource = &WorkspacesConnection{}
// AzureName returns the Azure name of the resource
func (connection *WorkspacesConnection) AzureName() string {
return connection.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (connection WorkspacesConnection) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetResourceKind returns the kind of the resource
func (connection *WorkspacesConnection) GetResourceKind() genruntime.ResourceKind {
return genruntime.ResourceKindNormal
}
// GetSpec returns the specification of this resource
func (connection *WorkspacesConnection) GetSpec() genruntime.ConvertibleSpec {
return &connection.Spec
}
// GetStatus returns the status of this resource
func (connection *WorkspacesConnection) GetStatus() genruntime.ConvertibleStatus {
return &connection.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/connections"
func (connection *WorkspacesConnection) GetType() string {
return "Microsoft.MachineLearningServices/workspaces/connections"
}
// NewEmptyStatus returns a new empty (blank) status
func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleStatus {
return &WorkspaceConnection_Status{}
}
// Owner returns the ResourceReference of the owner, or nil if there is no owner
func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(connection.Spec)
return &genruntime.ResourceReference{
Group: group,
Kind: kind,
Name: connection.Spec.Owner.Name,
}
}
// SetStatus sets the status of this resource
func (connection *WorkspacesConnection) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*WorkspaceConnection_Status); ok {
connection.Status = *st
return nil
}
// Convert status to required version
var st WorkspaceConnection_Status
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
connection.Status = st
return nil
}
// +kubebuilder:webhook:path=/validate-machinelearningservices-azure-com-v1beta20210701-workspacesconnection,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspacesconnections,verbs=create;update,versions=v1beta20210701,name=validate.v1beta20210701.workspacesconnections.machinelearningservices.azure.com,admissionReviewVersions=v1beta1
var _ admission.Validator = &WorkspacesConnection{}
// ValidateCreate validates the creation of the resource
func (connection *WorkspacesConnection) ValidateCreate() error {
validations := connection.createValidations()
var temp interface{} = connection
if runtimeValidator, ok := temp.(genruntime.Validator); ok {
validations = append(validations, runtimeValidator.CreateValidations()...)
}
var errs []error
for _, validation := range validations {
err := validation()
if err != nil {
errs = append(errs, err)
}
}
return kerrors.NewAggregate(errs)
}
// ValidateDelete validates the deletion of the resource
func (connection *WorkspacesConnection) ValidateDelete() error {
validations := connection.deleteValidations()
var temp interface{} = connection
if runtimeValidator, ok := temp.(genruntime.Validator); ok {
validations = append(validations, runtimeValidator.DeleteValidations()...)
}
var errs []error
for _, validation := range validations {
err := validation()
if err != nil {
errs = append(errs, err)
}
}
return kerrors.NewAggregate(errs)
}
// ValidateUpdate validates an update of the resource
func (connection *WorkspacesConnection) ValidateUpdate(old runtime.Object) error {
validations := connection.updateValidations()
var temp interface{} = connection
if runtimeValidator, ok := temp.(genruntime.Validator); ok {
validations = append(validations, runtimeValidator.UpdateValidations()...)
}
var errs []error
for _, validation := range validations {
err := validation(old)
if err != nil {
errs = append(errs, err)
}
}
return kerrors.NewAggregate(errs)
}
// createValidations validates the creation of the resource
func (connection *WorkspacesConnection) createValidations() []func() error {
return []func() error{connection.validateResourceReferences}
}
// deleteValidations validates the deletion of the resource
func (connection *WorkspacesConnection) deleteValidations() []func() error {
return nil
}
// updateValidations validates the update of the resource
func (connection *WorkspacesConnection) updateValidations() []func(old runtime.Object) error {
return []func(old runtime.Object) error{
func(old runtime.Object) error {
return connection.validateResourceReferences()
},
connection.validateWriteOnceProperties}
}
// validateResourceReferences validates all resource references
func (connection *WorkspacesConnection) validateResourceReferences() error {
refs, err := reflecthelpers.FindResourceReferences(&connection.Spec)
if err != nil {
return err
}
return genruntime.ValidateResourceReferences(refs)
}
// validateWriteOnceProperties validates all WriteOnce properties
func (connection *WorkspacesConnection) validateWriteOnceProperties(old runtime.Object) error {
oldObj, ok := old.(*WorkspacesConnection)
if !ok {
return nil
}
return genruntime.ValidateWriteOnceProperties(oldObj, connection)
}
// AssignPropertiesFromWorkspacesConnection populates our WorkspacesConnection from the provided source WorkspacesConnection
func (connection *WorkspacesConnection) AssignPropertiesFromWorkspacesConnection(source *v20210701s.WorkspacesConnection) error {
// ObjectMeta
connection.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec WorkspacesConnections_Spec
err := spec.AssignPropertiesFromWorkspacesConnectionsSpec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignPropertiesFromWorkspacesConnectionsSpec() to populate field Spec")
}
connection.Spec = spec
// Status
var status WorkspaceConnection_Status
err = status.AssignPropertiesFromWorkspaceConnectionStatus(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignPropertiesFromWorkspaceConnectionStatus() to populate field Status")
}
connection.Status = status
// No error
return nil
}
// AssignPropertiesToWorkspacesConnection populates the provided destination WorkspacesConnection from our WorkspacesConnection
func (connection *WorkspacesConnection) AssignPropertiesToWorkspacesConnection(destination *v20210701s.WorkspacesConnection) error {
// ObjectMeta
destination.ObjectMeta = *connection.ObjectMeta.DeepCopy()
// Spec
var spec v20210701s.WorkspacesConnections_Spec
err := connection.Spec.AssignPropertiesToWorkspacesConnectionsSpec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignPropertiesToWorkspacesConnectionsSpec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20210701s.WorkspaceConnection_Status
err = connection.Status.AssignPropertiesToWorkspaceConnectionStatus(&status)
if err != nil {
return errors.Wrap(err, "calling AssignPropertiesToWorkspaceConnectionStatus() to populate field Status")
}
destination.Status = status
// No error
return nil
}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (connection *WorkspacesConnection) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: connection.Spec.OriginalVersion(),
Kind: "WorkspacesConnection",
}
}
// +kubebuilder:object:root=true
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections
type WorkspacesConnectionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkspacesConnection `json:"items"`
}
type WorkspaceConnection_Status struct {
// AuthType: Authorization type of the workspace connection.
AuthType *string `json:"authType,omitempty"`
// Category: Category of the workspace connection.
Category *string `json:"category,omitempty"`
// Conditions: The observed state of the resource
Conditions []conditions.Condition `json:"conditions,omitempty"`
// Id: ResourceId of the workspace connection.
Id *string `json:"id,omitempty"`
// Name: Friendly name of the workspace connection.
Name *string `json:"name,omitempty"`
// Target: Target of the workspace connection.
Target *string `json:"target,omitempty"`
// Type: Resource type of workspace connection.
Type *string `json:"type,omitempty"`
// Value: Value details of the workspace connection.
Value *string `json:"value,omitempty"`
// ValueFormat: format for the workspace connection value
ValueFormat *WorkspaceConnectionPropsStatusValueFormat `json:"valueFormat,omitempty"`
}
var _ genruntime.ConvertibleStatus = &WorkspaceConnection_Status{}
// ConvertStatusFrom populates our WorkspaceConnection_Status from the provided source
func (connection *WorkspaceConnection_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20210701s.WorkspaceConnection_Status)
if ok {
// Populate our instance from source
return connection.AssignPropertiesFromWorkspaceConnectionStatus(src)
}
// Convert to an intermediate form
src = &v20210701s.WorkspaceConnection_Status{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = connection.AssignPropertiesFromWorkspaceConnectionStatus(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()")
}
return nil
}
// ConvertStatusTo populates the provided destination from our WorkspaceConnection_Status
func (connection *WorkspaceConnection_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20210701s.WorkspaceConnection_Status)
if ok {
// Populate destination from our instance
return connection.AssignPropertiesToWorkspaceConnectionStatus(dst)
}
// Convert to an intermediate form
dst = &v20210701s.WorkspaceConnection_Status{}
err := connection.AssignPropertiesToWorkspaceConnectionStatus(dst)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()")
}
// Update dst from our instance
err = dst.ConvertStatusTo(destination)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusTo()")
}
return nil
}
var _ genruntime.FromARMConverter = &WorkspaceConnection_Status{}
// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (connection *WorkspaceConnection_Status) NewEmptyARMValue() genruntime.ARMResourceStatus {
return &WorkspaceConnection_StatusARM{}
}
// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (connection *WorkspaceConnection_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
typedInput, ok := armInput.(WorkspaceConnection_StatusARM)
if !ok {
return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected WorkspaceConnection_StatusARM, got %T", armInput)
}
// Set property AuthType:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.AuthType != nil {
authType := *typedInput.Properties.AuthType
connection.AuthType = &authType
}
}
// Set property Category:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Category != nil {
category := *typedInput.Properties.Category
connection.Category = &category
}
}
// no assignment for property Conditions
// Set property Id:
if typedInput.Id != nil {
id := *typedInput.Id
connection.Id = &id
}
// Set property Name:
if typedInput.Name != nil {
name := *typedInput.Name
connection.Name = &name
}
// Set property Target:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Target != nil {
target := *typedInput.Properties.Target
connection.Target = &target
}
}
// Set property Type:
if typedInput.Type != nil {
typeVar := *typedInput.Type
connection.Type = &typeVar
}
// Set property Value:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Value != nil {
value := *typedInput.Properties.Value
connection.Value = &value
}
}
// Set property ValueFormat:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ValueFormat != nil {
valueFormat := *typedInput.Properties.ValueFormat
connection.ValueFormat = &valueFormat
}
}
// No error
return nil
}
// AssignPropertiesFromWorkspaceConnectionStatus populates our WorkspaceConnection_Status from the provided source WorkspaceConnection_Status
func (connection *WorkspaceConnection_Status) AssignPropertiesFromWorkspaceConnectionStatus(source *v20210701s.WorkspaceConnection_Status) error {
// AuthType
connection.AuthType = genruntime.ClonePointerToString(source.AuthType)
// Category
connection.Category = genruntime.ClonePointerToString(source.Category)
// Conditions
connection.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// Id
connection.Id = genruntime.ClonePointerToString(source.Id)
// Name
connection.Name = genruntime.ClonePointerToString(source.Name)
// Target
connection.Target = genruntime.ClonePointerToString(source.Target)
// Type
connection.Type = genruntime.ClonePointerToString(source.Type)
// Value
connection.Value = genruntime.ClonePointerToString(source.Value)
// ValueFormat
if source.ValueFormat != nil {
valueFormat := WorkspaceConnectionPropsStatusValueFormat(*source.ValueFormat)
connection.ValueFormat = &valueFormat
} else {
connection.ValueFormat = nil
}
// No error
return nil
}
// AssignPropertiesToWorkspaceConnectionStatus populates the provided destination WorkspaceConnection_Status from our WorkspaceConnection_Status
func (connection *WorkspaceConnection_Status) AssignPropertiesToWorkspaceConnectionStatus(destination *v20210701s.WorkspaceConnection_Status) error {
// Create a new property bag
propertyBag := genruntime.NewPropertyBag()
// AuthType
destination.AuthType = genruntime.ClonePointerToString(connection.AuthType)
// Category
destination.Category = genruntime.ClonePointerToString(connection.Category)
// Conditions
destination.Conditions = genruntime.CloneSliceOfCondition(connection.Conditions)
// Id
destination.Id = genruntime.ClonePointerToString(connection.Id)
// Name
destination.Name = genruntime.ClonePointerToString(connection.Name)
// Target
destination.Target = genruntime.ClonePointerToString(connection.Target)
// Type
destination.Type = genruntime.ClonePointerToString(connection.Type)
// Value
destination.Value = genruntime.ClonePointerToString(connection.Value)
// ValueFormat
if connection.ValueFormat != nil {
valueFormat := string(*connection.ValueFormat)
destination.ValueFormat = &valueFormat
} else {
destination.ValueFormat = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// No error
return nil
}
type WorkspacesConnections_Spec struct {
// AuthType: Authorization type of the workspace connection.
AuthType *string `json:"authType,omitempty"`
// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
// doesn't have to be.
AzureName string `json:"azureName,omitempty"`
// Category: Category of the workspace connection.
Category *string `json:"category,omitempty"`
// Location: Location to deploy resource to
Location *string `json:"location,omitempty"`
// +kubebuilder:validation:Required
// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
// reference to a machinelearningservices.azure.com/Workspace resource
Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"`
// Tags: Name-value pairs to add to the resource
Tags map[string]string `json:"tags,omitempty"`
// Target: Target of the workspace connection.
Target *string `json:"target,omitempty"`
// Value: Value details of the workspace connection.
Value *string `json:"value,omitempty"`
// ValueFormat: format for the workspace connection value.
ValueFormat *WorkspaceConnectionPropsValueFormat `json:"valueFormat,omitempty"`
}
var _ genruntime.ARMTransformer = &WorkspacesConnections_Spec{}
// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (connections *WorkspacesConnections_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
if connections == nil {
return nil, nil
}
result := &WorkspacesConnections_SpecARM{}
// Set property Location:
if connections.Location != nil {
location := *connections.Location
result.Location = &location
}
// Set property Name:
result.Name = resolved.Name
// Set property Properties:
if connections.AuthType != nil ||
connections.Category != nil ||
connections.Target != nil ||
connections.Value != nil ||
connections.ValueFormat != nil {
result.Properties = &WorkspaceConnectionPropsARM{}
}
if connections.AuthType != nil {
authType := *connections.AuthType
result.Properties.AuthType = &authType
}
if connections.Category != nil {
category := *connections.Category
result.Properties.Category = &category
}
if connections.Target != nil {
target := *connections.Target
result.Properties.Target = &target
}
if connections.Value != nil {
value := *connections.Value
result.Properties.Value = &value
}
if connections.ValueFormat != nil {
valueFormat := *connections.ValueFormat
result.Properties.ValueFormat = &valueFormat
}
// Set property Tags:
if connections.Tags != nil {
result.Tags = make(map[string]string, len(connections.Tags))
for key, tagsValue := range connections.Tags {
result.Tags[key] = tagsValue
}
}
return result, nil
}
// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (connections *WorkspacesConnections_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {
return &WorkspacesConnections_SpecARM{}
}
// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (connections *WorkspacesConnections_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
typedInput, ok := armInput.(WorkspacesConnections_SpecARM)
if !ok {
return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected WorkspacesConnections_SpecARM, got %T", armInput)
}
// Set property AuthType:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.AuthType != nil {
authType := *typedInput.Properties.AuthType
connections.AuthType = &authType
}
}
// Set property AzureName:
connections.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name))
// Set property Category:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Category != nil {
category := *typedInput.Properties.Category
connections.Category = &category
}
}
// Set property Location:
if typedInput.Location != nil {
location := *typedInput.Location
connections.Location = &location
}
// Set property Owner:
connections.Owner = &genruntime.KnownResourceReference{
Name: owner.Name,
}
// Set property Tags:
if typedInput.Tags != nil {
connections.Tags = make(map[string]string, len(typedInput.Tags))
for key, value := range typedInput.Tags {
connections.Tags[key] = value
}
}
// Set property Target:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Target != nil {
target := *typedInput.Properties.Target
connections.Target = &target
}
}
// Set property Value:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Value != nil {
value := *typedInput.Properties.Value
connections.Value = &value
}
}
// Set property ValueFormat:
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ValueFormat != nil {
valueFormat := *typedInput.Properties.ValueFormat
connections.ValueFormat = &valueFormat
}
}
// No error
return nil
}
var _ genruntime.ConvertibleSpec = &WorkspacesConnections_Spec{}
// ConvertSpecFrom populates our WorkspacesConnections_Spec from the provided source
func (connections *WorkspacesConnections_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20210701s.WorkspacesConnections_Spec)
if ok {
// Populate our instance from source
return connections.AssignPropertiesFromWorkspacesConnectionsSpec(src)
}
// Convert to an intermediate form
src = &v20210701s.WorkspacesConnections_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = connections.AssignPropertiesFromWorkspacesConnectionsSpec(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()")
}
return nil
}
// ConvertSpecTo populates the provided destination from our WorkspacesConnections_Spec
func (connections *WorkspacesConnections_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20210701s.WorkspacesConnections_Spec)
if ok {
// Populate destination from our instance
return connections.AssignPropertiesToWorkspacesConnectionsSpec(dst)
}
// Convert to an intermediate form
dst = &v20210701s.WorkspacesConnections_Spec{}
err := connections.AssignPropertiesToWorkspacesConnectionsSpec(dst)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()")
}
// Update dst from our instance
err = dst.ConvertSpecTo(destination)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecTo()")
}
return nil
}
// AssignPropertiesFromWorkspacesConnectionsSpec populates our WorkspacesConnections_Spec from the provided source WorkspacesConnections_Spec
func (connections *WorkspacesConnections_Spec) AssignPropertiesFromWorkspacesConnectionsSpec(source *v20210701s.WorkspacesConnections_Spec) error {
// AuthType
connections.AuthType = genruntime.ClonePointerToString(source.AuthType)
// AzureName
connections.AzureName = source.AzureName
// Category
connections.Category = genruntime.ClonePointerToString(source.Category)
// Location
connections.Location = genruntime.ClonePointerToString(source.Location)
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
connections.Owner = &owner
} else {
connections.Owner = nil
}
// Tags
connections.Tags = genruntime.CloneMapOfStringToString(source.Tags)
// Target
connections.Target = genruntime.ClonePointerToString(source.Target)
// Value
connections.Value = genruntime.ClonePointerToString(source.Value)
// ValueFormat
if source.ValueFormat != nil {
valueFormat := WorkspaceConnectionPropsValueFormat(*source.ValueFormat)
connections.ValueFormat = &valueFormat
} else {
connections.ValueFormat = nil
}
// No error
return nil
}
// AssignPropertiesToWorkspacesConnectionsSpec populates the provided destination WorkspacesConnections_Spec from our WorkspacesConnections_Spec
func (connections *WorkspacesConnections_Spec) AssignPropertiesToWorkspacesConnectionsSpec(destination *v20210701s.WorkspacesConnections_Spec) error {
// Create a new property bag
propertyBag := genruntime.NewPropertyBag()
// AuthType
destination.AuthType = genruntime.ClonePointerToString(connections.AuthType)
// AzureName
destination.AzureName = connections.AzureName
// Category
destination.Category = genruntime.ClonePointerToString(connections.Category)
// Location
destination.Location = genruntime.ClonePointerToString(connections.Location)
// OriginalVersion
destination.OriginalVersion = connections.OriginalVersion()
// Owner
if connections.Owner != nil {
owner := connections.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// Tags
destination.Tags = genruntime.CloneMapOfStringToString(connections.Tags)
// Target
destination.Target = genruntime.ClonePointerToString(connections.Target)
// Value
destination.Value = genruntime.ClonePointerToString(connections.Value)
// ValueFormat
if connections.ValueFormat != nil {
valueFormat := string(*connections.ValueFormat)
destination.ValueFormat = &valueFormat
} else {
destination.ValueFormat = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// No error
return nil
}
// OriginalVersion returns the original API version used to create the resource.
func (connections *WorkspacesConnections_Spec) OriginalVersion() string {
return GroupVersion.Version
}
// SetAzureName sets the Azure name of the resource
func (connections *WorkspacesConnections_Spec) SetAzureName(azureName string) {
connections.AzureName = azureName
}
// +kubebuilder:validation:Enum={"JSON"}
type WorkspaceConnectionPropsValueFormat string
const WorkspaceConnectionPropsValueFormatJSON = WorkspaceConnectionPropsValueFormat("JSON")
func init() {
SchemeBuilder.Register(&WorkspacesConnection{}, &WorkspacesConnectionList{})
}

Просмотреть файл

@ -0,0 +1,382 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_WorkspacesConnection_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip from WorkspacesConnection to hub returns original",
prop.ForAll(RunResourceConversionTestForWorkspacesConnection, WorkspacesConnectionGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}
// RunResourceConversionTestForWorkspacesConnection tests if a specific instance of WorkspacesConnection round trips to the hub storage version and back losslessly
func RunResourceConversionTestForWorkspacesConnection(subject WorkspacesConnection) string {
// Copy subject to make sure conversion doesn't modify it
copied := subject.DeepCopy()
// Convert to our hub version
var hub v20210701s.WorkspacesConnection
err := copied.ConvertTo(&hub)
if err != nil {
return err.Error()
}
// Convert from our hub version
var actual WorkspacesConnection
err = actual.ConvertFrom(&hub)
if err != nil {
return err.Error()
}
// Compare actual with what we started with
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
func Test_WorkspacesConnection_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip from WorkspacesConnection to WorkspacesConnection via AssignPropertiesToWorkspacesConnection & AssignPropertiesFromWorkspacesConnection returns original",
prop.ForAll(RunPropertyAssignmentTestForWorkspacesConnection, WorkspacesConnectionGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}
// RunPropertyAssignmentTestForWorkspacesConnection tests if a specific instance of WorkspacesConnection can be assigned to v1beta20210701storage and back losslessly
func RunPropertyAssignmentTestForWorkspacesConnection(subject WorkspacesConnection) string {
// Copy subject to make sure assignment doesn't modify it
copied := subject.DeepCopy()
// Use AssignPropertiesTo() for the first stage of conversion
var other v20210701s.WorkspacesConnection
err := copied.AssignPropertiesToWorkspacesConnection(&other)
if err != nil {
return err.Error()
}
// Use AssignPropertiesFrom() to convert back to our original type
var actual WorkspacesConnection
err = actual.AssignPropertiesFromWorkspacesConnection(&other)
if err != nil {
return err.Error()
}
// Check for a match
match := cmp.Equal(subject, actual)
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
func Test_WorkspacesConnection_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspacesConnection via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesConnection, WorkspacesConnectionGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesConnection runs a test to see if a specific instance of WorkspacesConnection round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesConnection(subject WorkspacesConnection) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspacesConnection
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspacesConnection instances for property testing - lazily instantiated by
// WorkspacesConnectionGenerator()
var workspacesConnectionGenerator gopter.Gen
// WorkspacesConnectionGenerator returns a generator of WorkspacesConnection instances for property testing.
func WorkspacesConnectionGenerator() gopter.Gen {
if workspacesConnectionGenerator != nil {
return workspacesConnectionGenerator
}
generators := make(map[string]gopter.Gen)
AddRelatedPropertyGeneratorsForWorkspacesConnection(generators)
workspacesConnectionGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnection{}), generators)
return workspacesConnectionGenerator
}
// AddRelatedPropertyGeneratorsForWorkspacesConnection is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesConnection(gens map[string]gopter.Gen) {
gens["Spec"] = WorkspacesConnectionsSpecGenerator()
gens["Status"] = WorkspaceConnectionStatusGenerator()
}
func Test_WorkspaceConnection_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip from WorkspaceConnection_Status to WorkspaceConnection_Status via AssignPropertiesToWorkspaceConnectionStatus & AssignPropertiesFromWorkspaceConnectionStatus returns original",
prop.ForAll(RunPropertyAssignmentTestForWorkspaceConnectionStatus, WorkspaceConnectionStatusGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}
// RunPropertyAssignmentTestForWorkspaceConnectionStatus tests if a specific instance of WorkspaceConnection_Status can be assigned to v1beta20210701storage and back losslessly
func RunPropertyAssignmentTestForWorkspaceConnectionStatus(subject WorkspaceConnection_Status) string {
// Copy subject to make sure assignment doesn't modify it
copied := subject.DeepCopy()
// Use AssignPropertiesTo() for the first stage of conversion
var other v20210701s.WorkspaceConnection_Status
err := copied.AssignPropertiesToWorkspaceConnectionStatus(&other)
if err != nil {
return err.Error()
}
// Use AssignPropertiesFrom() to convert back to our original type
var actual WorkspaceConnection_Status
err = actual.AssignPropertiesFromWorkspaceConnectionStatus(&other)
if err != nil {
return err.Error()
}
// Check for a match
match := cmp.Equal(subject, actual)
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
func Test_WorkspaceConnection_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspaceConnection_Status via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionStatus, WorkspaceConnectionStatusGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspaceConnectionStatus runs a test to see if a specific instance of WorkspaceConnection_Status round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspaceConnectionStatus(subject WorkspaceConnection_Status) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspaceConnection_Status
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspaceConnection_Status instances for property testing - lazily instantiated by
// WorkspaceConnectionStatusGenerator()
var workspaceConnectionStatusGenerator gopter.Gen
// WorkspaceConnectionStatusGenerator returns a generator of WorkspaceConnection_Status instances for property testing.
func WorkspaceConnectionStatusGenerator() gopter.Gen {
if workspaceConnectionStatusGenerator != nil {
return workspaceConnectionStatusGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(generators)
workspaceConnectionStatusGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_Status{}), generators)
return workspaceConnectionStatusGenerator
}
// AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(gens map[string]gopter.Gen) {
gens["AuthType"] = gen.PtrOf(gen.AlphaString())
gens["Category"] = gen.PtrOf(gen.AlphaString())
gens["Id"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.PtrOf(gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
gens["Type"] = gen.PtrOf(gen.AlphaString())
gens["Value"] = gen.PtrOf(gen.AlphaString())
gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsStatusValueFormatJSON))
}
func Test_WorkspacesConnections_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip from WorkspacesConnections_Spec to WorkspacesConnections_Spec via AssignPropertiesToWorkspacesConnectionsSpec & AssignPropertiesFromWorkspacesConnectionsSpec returns original",
prop.ForAll(RunPropertyAssignmentTestForWorkspacesConnectionsSpec, WorkspacesConnectionsSpecGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}
// RunPropertyAssignmentTestForWorkspacesConnectionsSpec tests if a specific instance of WorkspacesConnections_Spec can be assigned to v1beta20210701storage and back losslessly
func RunPropertyAssignmentTestForWorkspacesConnectionsSpec(subject WorkspacesConnections_Spec) string {
// Copy subject to make sure assignment doesn't modify it
copied := subject.DeepCopy()
// Use AssignPropertiesTo() for the first stage of conversion
var other v20210701s.WorkspacesConnections_Spec
err := copied.AssignPropertiesToWorkspacesConnectionsSpec(&other)
if err != nil {
return err.Error()
}
// Use AssignPropertiesFrom() to convert back to our original type
var actual WorkspacesConnections_Spec
err = actual.AssignPropertiesFromWorkspacesConnectionsSpec(&other)
if err != nil {
return err.Error()
}
// Check for a match
match := cmp.Equal(subject, actual)
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
func Test_WorkspacesConnections_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspacesConnections_Spec via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesConnectionsSpec, WorkspacesConnectionsSpecGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesConnectionsSpec runs a test to see if a specific instance of WorkspacesConnections_Spec round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesConnectionsSpec(subject WorkspacesConnections_Spec) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspacesConnections_Spec
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspacesConnections_Spec instances for property testing - lazily instantiated by
// WorkspacesConnectionsSpecGenerator()
var workspacesConnectionsSpecGenerator gopter.Gen
// WorkspacesConnectionsSpecGenerator returns a generator of WorkspacesConnections_Spec instances for property testing.
func WorkspacesConnectionsSpecGenerator() gopter.Gen {
if workspacesConnectionsSpecGenerator != nil {
return workspacesConnectionsSpecGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(generators)
workspacesConnectionsSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_Spec{}), generators)
return workspacesConnectionsSpecGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(gens map[string]gopter.Gen) {
gens["AuthType"] = gen.PtrOf(gen.AlphaString())
gens["AzureName"] = gen.AlphaString()
gens["Category"] = gen.PtrOf(gen.AlphaString())
gens["Location"] = gen.PtrOf(gen.AlphaString())
gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
gens["Value"] = gen.PtrOf(gen.AlphaString())
gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsValueFormatJSON))
}

Просмотреть файл

@ -0,0 +1,55 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import "github.com/Azure/azure-service-operator/v2/pkg/genruntime"
type WorkspacesConnections_SpecARM struct {
// Location: Location to deploy resource to
Location *string `json:"location,omitempty"`
// Name: Friendly name of the workspace connection
Name string `json:"name,omitempty"`
// Properties: Workspace Connection specific properties.
Properties *WorkspaceConnectionPropsARM `json:"properties,omitempty"`
// Tags: Name-value pairs to add to the resource
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ARMResourceSpec = &WorkspacesConnections_SpecARM{}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (connections WorkspacesConnections_SpecARM) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetName returns the Name of the resource
func (connections *WorkspacesConnections_SpecARM) GetName() string {
return connections.Name
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/connections"
func (connections *WorkspacesConnections_SpecARM) GetType() string {
return "Microsoft.MachineLearningServices/workspaces/connections"
}
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/WorkspaceConnectionProps
type WorkspaceConnectionPropsARM struct {
// AuthType: Authorization type of the workspace connection.
AuthType *string `json:"authType,omitempty"`
// Category: Category of the workspace connection.
Category *string `json:"category,omitempty"`
// Target: Target of the workspace connection.
Target *string `json:"target,omitempty"`
// Value: Value details of the workspace connection.
Value *string `json:"value,omitempty"`
// ValueFormat: format for the workspace connection value.
ValueFormat *WorkspaceConnectionPropsValueFormat `json:"valueFormat,omitempty"`
}

Просмотреть файл

@ -0,0 +1,158 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_WorkspacesConnections_SpecARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspacesConnections_SpecARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesConnectionsSpecARM, WorkspacesConnectionsSpecARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesConnectionsSpecARM runs a test to see if a specific instance of WorkspacesConnections_SpecARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesConnectionsSpecARM(subject WorkspacesConnections_SpecARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspacesConnections_SpecARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspacesConnections_SpecARM instances for property testing - lazily instantiated by
// WorkspacesConnectionsSpecARMGenerator()
var workspacesConnectionsSpecARMGenerator gopter.Gen
// WorkspacesConnectionsSpecARMGenerator returns a generator of WorkspacesConnections_SpecARM instances for property testing.
// We first initialize workspacesConnectionsSpecARMGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func WorkspacesConnectionsSpecARMGenerator() gopter.Gen {
if workspacesConnectionsSpecARMGenerator != nil {
return workspacesConnectionsSpecARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM(generators)
workspacesConnectionsSpecARMGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_SpecARM{}), generators)
// The above call to gen.Struct() captures the map, so create a new one
generators = make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM(generators)
AddRelatedPropertyGeneratorsForWorkspacesConnectionsSpecARM(generators)
workspacesConnectionsSpecARMGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_SpecARM{}), generators)
return workspacesConnectionsSpecARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM(gens map[string]gopter.Gen) {
gens["Location"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.AlphaString()
gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())
}
// AddRelatedPropertyGeneratorsForWorkspacesConnectionsSpecARM is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesConnectionsSpecARM(gens map[string]gopter.Gen) {
gens["Properties"] = gen.PtrOf(WorkspaceConnectionPropsARMGenerator())
}
func Test_WorkspaceConnectionPropsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspaceConnectionPropsARM via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionPropsARM, WorkspaceConnectionPropsARMGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspaceConnectionPropsARM runs a test to see if a specific instance of WorkspaceConnectionPropsARM round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspaceConnectionPropsARM(subject WorkspaceConnectionPropsARM) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspaceConnectionPropsARM
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspaceConnectionPropsARM instances for property testing - lazily instantiated by
// WorkspaceConnectionPropsARMGenerator()
var workspaceConnectionPropsARMGenerator gopter.Gen
// WorkspaceConnectionPropsARMGenerator returns a generator of WorkspaceConnectionPropsARM instances for property testing.
func WorkspaceConnectionPropsARMGenerator() gopter.Gen {
if workspaceConnectionPropsARMGenerator != nil {
return workspaceConnectionPropsARMGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsARM(generators)
workspaceConnectionPropsARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnectionPropsARM{}), generators)
return workspaceConnectionPropsARMGenerator
}
// AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsARM is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsARM(gens map[string]gopter.Gen) {
gens["AuthType"] = gen.PtrOf(gen.AlphaString())
gens["Category"] = gen.PtrOf(gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
gens["Value"] = gen.PtrOf(gen.AlphaString())
gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsValueFormatJSON))
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,31 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Package v1beta20210701storage contains API Schema definitions for the machinelearningservices v1beta20210701storage API group
// +kubebuilder:object:generate=true
// All object properties are optional by default, this will be overridden when needed:
// +kubebuilder:validation:Optional
// +groupName=machinelearningservices.azure.com
package v1beta20210701storage
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "machinelearningservices.azure.com", Version: "v1beta20210701storage"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
localSchemeBuilder = SchemeBuilder.SchemeBuilder
)

Просмотреть файл

@ -0,0 +1,471 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701storage
import (
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources=workspaces,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources={workspaces/status,workspaces/finalizers},verbs=get;update;patch
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1beta20210701.Workspace
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces
type Workspace struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec Workspaces_Spec `json:"spec,omitempty"`
Status Workspace_Status `json:"status,omitempty"`
}
var _ conditions.Conditioner = &Workspace{}
// GetConditions returns the conditions of the resource
func (workspace *Workspace) GetConditions() conditions.Conditions {
return workspace.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (workspace *Workspace) SetConditions(conditions conditions.Conditions) {
workspace.Status.Conditions = conditions
}
var _ genruntime.KubernetesResource = &Workspace{}
// AzureName returns the Azure name of the resource
func (workspace *Workspace) AzureName() string {
return workspace.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (workspace Workspace) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetResourceKind returns the kind of the resource
func (workspace *Workspace) GetResourceKind() genruntime.ResourceKind {
return genruntime.ResourceKindNormal
}
// GetSpec returns the specification of this resource
func (workspace *Workspace) GetSpec() genruntime.ConvertibleSpec {
return &workspace.Spec
}
// GetStatus returns the status of this resource
func (workspace *Workspace) GetStatus() genruntime.ConvertibleStatus {
return &workspace.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces"
func (workspace *Workspace) GetType() string {
return "Microsoft.MachineLearningServices/workspaces"
}
// NewEmptyStatus returns a new empty (blank) status
func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus {
return &Workspace_Status{}
}
// Owner returns the ResourceReference of the owner, or nil if there is no owner
func (workspace *Workspace) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec)
return &genruntime.ResourceReference{
Group: group,
Kind: kind,
Name: workspace.Spec.Owner.Name,
}
}
// SetStatus sets the status of this resource
func (workspace *Workspace) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*Workspace_Status); ok {
workspace.Status = *st
return nil
}
// Convert status to required version
var st Workspace_Status
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
workspace.Status = st
return nil
}
// Hub marks that this Workspace is the hub type for conversion
func (workspace *Workspace) Hub() {}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (workspace *Workspace) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: workspace.Spec.OriginalVersion,
Kind: "Workspace",
}
}
// +kubebuilder:object:root=true
// Storage version of v1beta20210701.Workspace
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces
type WorkspaceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workspace `json:"items"`
}
// Storage version of v1beta20210701.APIVersion
// +kubebuilder:validation:Enum={"2021-07-01"}
type APIVersion string
const APIVersionValue = APIVersion("2021-07-01")
// Storage version of v1beta20210701.Workspace_Status
type Workspace_Status struct {
AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"`
ApplicationInsights *string `json:"applicationInsights,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
ContainerRegistry *string `json:"containerRegistry,omitempty"`
Description *string `json:"description,omitempty"`
DiscoveryUrl *string `json:"discoveryUrl,omitempty"`
Encryption *EncryptionProperty_Status `json:"encryption,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
HbiWorkspace *bool `json:"hbiWorkspace,omitempty"`
Id *string `json:"id,omitempty"`
Identity *Identity_Status `json:"identity,omitempty"`
ImageBuildCompute *string `json:"imageBuildCompute,omitempty"`
KeyVault *string `json:"keyVault,omitempty"`
Location *string `json:"location,omitempty"`
MlFlowTrackingUri *string `json:"mlFlowTrackingUri,omitempty"`
Name *string `json:"name,omitempty"`
NotebookInfo *NotebookResourceInfo_Status `json:"notebookInfo,omitempty"`
PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"`
PrivateEndpointConnections []PrivateEndpointConnection_Status_SubResourceEmbedded `json:"privateEndpointConnections,omitempty"`
PrivateLinkCount *int `json:"privateLinkCount,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"`
ServiceManagedResourcesSettings *ServiceManagedResourcesSettings_Status `json:"serviceManagedResourcesSettings,omitempty"`
ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"`
SharedPrivateLinkResources []SharedPrivateLinkResource_Status `json:"sharedPrivateLinkResources,omitempty"`
Sku *Sku_Status `json:"sku,omitempty"`
StorageAccount *string `json:"storageAccount,omitempty"`
StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"`
SystemData *SystemData_Status `json:"systemData,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
TenantId *string `json:"tenantId,omitempty"`
Type *string `json:"type,omitempty"`
WorkspaceId *string `json:"workspaceId,omitempty"`
}
var _ genruntime.ConvertibleStatus = &Workspace_Status{}
// ConvertStatusFrom populates our Workspace_Status from the provided source
func (workspace *Workspace_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
if source == workspace {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return source.ConvertStatusTo(workspace)
}
// ConvertStatusTo populates the provided destination from our Workspace_Status
func (workspace *Workspace_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
if destination == workspace {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return destination.ConvertStatusFrom(workspace)
}
// Storage version of v1beta20210701.Workspaces_Spec
type Workspaces_Spec struct {
AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"`
// ApplicationInsightsReference: ARM id of the application insights associated with this workspace. This cannot be changed
// once the workspace has been created
ApplicationInsightsReference *genruntime.ResourceReference `armReference:"ApplicationInsights" json:"applicationInsightsReference,omitempty"`
// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
// doesn't have to be.
AzureName string `json:"azureName,omitempty"`
// ContainerRegistryReference: ARM id of the container registry associated with this workspace. This cannot be changed once
// the workspace has been created
ContainerRegistryReference *genruntime.ResourceReference `armReference:"ContainerRegistry" json:"containerRegistryReference,omitempty"`
Description *string `json:"description,omitempty"`
DiscoveryUrl *string `json:"discoveryUrl,omitempty"`
Encryption *EncryptionProperty `json:"encryption,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
HbiWorkspace *bool `json:"hbiWorkspace,omitempty"`
Identity *Identity `json:"identity,omitempty"`
ImageBuildCompute *string `json:"imageBuildCompute,omitempty"`
// KeyVaultReference: ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has
// been created
KeyVaultReference *genruntime.ResourceReference `armReference:"KeyVault" json:"keyVaultReference,omitempty"`
Location *string `json:"location,omitempty"`
OperatorSpec *WorkspaceOperatorSpec `json:"operatorSpec,omitempty"`
OriginalVersion string `json:"originalVersion,omitempty"`
// +kubebuilder:validation:Required
// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
// reference to a resources.azure.com/ResourceGroup resource
Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`
// PrimaryUserAssignedIdentityReference: The user assigned identity resource id that represents the workspace identity.
PrimaryUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"PrimaryUserAssignedIdentity" json:"primaryUserAssignedIdentityReference,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"`
ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"`
SharedPrivateLinkResources []Workspaces_Spec_Properties_SharedPrivateLinkResources `json:"sharedPrivateLinkResources,omitempty"`
Sku *Sku `json:"sku,omitempty"`
// StorageAccountReference: ARM id of the storage account associated with this workspace. This cannot be changed once the
// workspace has been created
StorageAccountReference *genruntime.ResourceReference `armReference:"StorageAccount" json:"storageAccountReference,omitempty"`
SystemData *SystemData `json:"systemData,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ConvertibleSpec = &Workspaces_Spec{}
// ConvertSpecFrom populates our Workspaces_Spec from the provided source
func (workspaces *Workspaces_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
if source == workspaces {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return source.ConvertSpecTo(workspaces)
}
// ConvertSpecTo populates the provided destination from our Workspaces_Spec
func (workspaces *Workspaces_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
if destination == workspaces {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return destination.ConvertSpecFrom(workspaces)
}
// Storage version of v1beta20210701.EncryptionProperty
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/EncryptionProperty
type EncryptionProperty struct {
Identity *IdentityForCmk `json:"identity,omitempty"`
KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Status *string `json:"status,omitempty"`
}
// Storage version of v1beta20210701.EncryptionProperty_Status
type EncryptionProperty_Status struct {
Identity *IdentityForCmk_Status `json:"identity,omitempty"`
KeyVaultProperties *KeyVaultProperties_Status `json:"keyVaultProperties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Status *string `json:"status,omitempty"`
}
// Storage version of v1beta20210701.Identity
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Identity
type Identity struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Type *string `json:"type,omitempty"`
UserAssignedIdentities map[string]v1.JSON `json:"userAssignedIdentities,omitempty"`
}
// Storage version of v1beta20210701.Identity_Status
type Identity_Status struct {
PrincipalId *string `json:"principalId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
TenantId *string `json:"tenantId,omitempty"`
Type *string `json:"type,omitempty"`
UserAssignedIdentities map[string]UserAssignedIdentity_Status `json:"userAssignedIdentities,omitempty"`
}
// Storage version of v1beta20210701.NotebookResourceInfo_Status
type NotebookResourceInfo_Status struct {
Fqdn *string `json:"fqdn,omitempty"`
NotebookPreparationError *NotebookPreparationError_Status `json:"notebookPreparationError,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
// Storage version of v1beta20210701.PrivateEndpointConnection_Status_SubResourceEmbedded
type PrivateEndpointConnection_Status_SubResourceEmbedded struct {
Id *string `json:"id,omitempty"`
Identity *Identity_Status `json:"identity,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Sku *Sku_Status `json:"sku,omitempty"`
SystemData *SystemData_Status `json:"systemData,omitempty"`
}
// Storage version of v1beta20210701.ServiceManagedResourcesSettings
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ServiceManagedResourcesSettings
type ServiceManagedResourcesSettings struct {
CosmosDb *CosmosDbSettings `json:"cosmosDb,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.ServiceManagedResourcesSettings_Status
type ServiceManagedResourcesSettings_Status struct {
CosmosDb *CosmosDbSettings_Status `json:"cosmosDb,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.SharedPrivateLinkResource_Status
type SharedPrivateLinkResource_Status struct {
GroupId *string `json:"groupId,omitempty"`
Name *string `json:"name,omitempty"`
PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RequestMessage *string `json:"requestMessage,omitempty"`
Status *string `json:"status,omitempty"`
}
// Storage version of v1beta20210701.Sku
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Sku
type Sku struct {
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Tier *string `json:"tier,omitempty"`
}
// Storage version of v1beta20210701.Sku_Status
type Sku_Status struct {
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Tier *string `json:"tier,omitempty"`
}
// Storage version of v1beta20210701.SystemData
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SystemData
type SystemData struct {
CreatedAt *string `json:"createdAt,omitempty"`
CreatedBy *string `json:"createdBy,omitempty"`
CreatedByType *string `json:"createdByType,omitempty"`
LastModifiedAt *string `json:"lastModifiedAt,omitempty"`
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
LastModifiedByType *string `json:"lastModifiedByType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.SystemData_Status
type SystemData_Status struct {
CreatedAt *string `json:"createdAt,omitempty"`
CreatedBy *string `json:"createdBy,omitempty"`
CreatedByType *string `json:"createdByType,omitempty"`
LastModifiedAt *string `json:"lastModifiedAt,omitempty"`
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
LastModifiedByType *string `json:"lastModifiedByType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.WorkspaceOperatorSpec
// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type WorkspaceOperatorSpec struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Secrets *WorkspaceOperatorSecrets `json:"secrets,omitempty"`
}
// Storage version of v1beta20210701.Workspaces_Spec_Properties_SharedPrivateLinkResources
type Workspaces_Spec_Properties_SharedPrivateLinkResources struct {
GroupId *string `json:"groupId,omitempty"`
Name *string `json:"name,omitempty"`
// PrivateLinkResourceReference: The resource id that private link links to.
PrivateLinkResourceReference *genruntime.ResourceReference `armReference:"PrivateLinkResourceId" json:"privateLinkResourceReference,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RequestMessage *string `json:"requestMessage,omitempty"`
Status *string `json:"status,omitempty"`
}
// Storage version of v1beta20210701.CosmosDbSettings
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/CosmosDbSettings
type CosmosDbSettings struct {
CollectionsThroughput *int `json:"collectionsThroughput,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.CosmosDbSettings_Status
type CosmosDbSettings_Status struct {
CollectionsThroughput *int `json:"collectionsThroughput,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.IdentityForCmk
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/IdentityForCmk
type IdentityForCmk struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}
// Storage version of v1beta20210701.IdentityForCmk_Status
type IdentityForCmk_Status struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}
// Storage version of v1beta20210701.KeyVaultProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/KeyVaultProperties
type KeyVaultProperties struct {
IdentityClientId *string `json:"identityClientId,omitempty"`
KeyIdentifier *string `json:"keyIdentifier,omitempty"`
KeyVaultArmId *string `json:"keyVaultArmId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.KeyVaultProperties_Status
type KeyVaultProperties_Status struct {
IdentityClientId *string `json:"identityClientId,omitempty"`
KeyIdentifier *string `json:"keyIdentifier,omitempty"`
KeyVaultArmId *string `json:"keyVaultArmId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.NotebookPreparationError_Status
type NotebookPreparationError_Status struct {
ErrorMessage *string `json:"errorMessage,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
StatusCode *int `json:"statusCode,omitempty"`
}
// Storage version of v1beta20210701.UserAssignedIdentity_Status
type UserAssignedIdentity_Status struct {
ClientId *string `json:"clientId,omitempty"`
PrincipalId *string `json:"principalId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
TenantId *string `json:"tenantId,omitempty"`
}
// Storage version of v1beta20210701.WorkspaceOperatorSecrets
type WorkspaceOperatorSecrets struct {
AppInsightsInstrumentationKey *genruntime.SecretDestination `json:"appInsightsInstrumentationKey,omitempty"`
ContainerRegistryPassword *genruntime.SecretDestination `json:"containerRegistryPassword,omitempty"`
ContainerRegistryPassword2 *genruntime.SecretDestination `json:"containerRegistryPassword2,omitempty"`
ContainerRegistryUserName *genruntime.SecretDestination `json:"containerRegistryUserName,omitempty"`
PrimaryNotebookAccessKey *genruntime.SecretDestination `json:"primaryNotebookAccessKey,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SecondaryNotebookAccessKey *genruntime.SecretDestination `json:"secondaryNotebookAccessKey,omitempty"`
UserStorageKey *genruntime.SecretDestination `json:"userStorageKey,omitempty"`
}
func init() {
SchemeBuilder.Register(&Workspace{}, &WorkspaceList{})
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,620 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701storage
import (
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources=workspacescomputes,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources={workspacescomputes/status,workspacescomputes/finalizers},verbs=get;update;patch
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1beta20210701.WorkspacesCompute
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_computes
type WorkspacesCompute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkspacesComputes_Spec `json:"spec,omitempty"`
Status ComputeResource_Status `json:"status,omitempty"`
}
var _ conditions.Conditioner = &WorkspacesCompute{}
// GetConditions returns the conditions of the resource
func (compute *WorkspacesCompute) GetConditions() conditions.Conditions {
return compute.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (compute *WorkspacesCompute) SetConditions(conditions conditions.Conditions) {
compute.Status.Conditions = conditions
}
var _ genruntime.KubernetesResource = &WorkspacesCompute{}
// AzureName returns the Azure name of the resource
func (compute *WorkspacesCompute) AzureName() string {
return compute.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (compute WorkspacesCompute) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetResourceKind returns the kind of the resource
func (compute *WorkspacesCompute) GetResourceKind() genruntime.ResourceKind {
return genruntime.ResourceKindNormal
}
// GetSpec returns the specification of this resource
func (compute *WorkspacesCompute) GetSpec() genruntime.ConvertibleSpec {
return &compute.Spec
}
// GetStatus returns the status of this resource
func (compute *WorkspacesCompute) GetStatus() genruntime.ConvertibleStatus {
return &compute.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/computes"
func (compute *WorkspacesCompute) GetType() string {
return "Microsoft.MachineLearningServices/workspaces/computes"
}
// NewEmptyStatus returns a new empty (blank) status
func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus {
return &ComputeResource_Status{}
}
// Owner returns the ResourceReference of the owner, or nil if there is no owner
func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(compute.Spec)
return &genruntime.ResourceReference{
Group: group,
Kind: kind,
Name: compute.Spec.Owner.Name,
}
}
// SetStatus sets the status of this resource
func (compute *WorkspacesCompute) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*ComputeResource_Status); ok {
compute.Status = *st
return nil
}
// Convert status to required version
var st ComputeResource_Status
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
compute.Status = st
return nil
}
// Hub marks that this WorkspacesCompute is the hub type for conversion
func (compute *WorkspacesCompute) Hub() {}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (compute *WorkspacesCompute) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: compute.Spec.OriginalVersion,
Kind: "WorkspacesCompute",
}
}
// +kubebuilder:object:root=true
// Storage version of v1beta20210701.WorkspacesCompute
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_computes
type WorkspacesComputeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkspacesCompute `json:"items"`
}
// Storage version of v1beta20210701.ComputeResource_Status
type ComputeResource_Status struct {
Conditions []conditions.Condition `json:"conditions,omitempty"`
Id *string `json:"id,omitempty"`
Identity *Identity_Status `json:"identity,omitempty"`
Location *string `json:"location,omitempty"`
Name *string `json:"name,omitempty"`
Properties *Compute_Status `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Sku *Sku_Status `json:"sku,omitempty"`
SystemData *SystemData_Status `json:"systemData,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Type *string `json:"type,omitempty"`
}
var _ genruntime.ConvertibleStatus = &ComputeResource_Status{}
// ConvertStatusFrom populates our ComputeResource_Status from the provided source
func (resource *ComputeResource_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
if source == resource {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return source.ConvertStatusTo(resource)
}
// ConvertStatusTo populates the provided destination from our ComputeResource_Status
func (resource *ComputeResource_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
if destination == resource {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return destination.ConvertStatusFrom(resource)
}
// Storage version of v1beta20210701.WorkspacesComputes_Spec
type WorkspacesComputes_Spec struct {
// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
// doesn't have to be.
AzureName string `json:"azureName,omitempty"`
Identity *Identity `json:"identity,omitempty"`
Location *string `json:"location,omitempty"`
OriginalVersion string `json:"originalVersion,omitempty"`
// +kubebuilder:validation:Required
// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
// reference to a machinelearningservices.azure.com/Workspace resource
Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"`
Properties *Compute `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Sku *Sku `json:"sku,omitempty"`
SystemData *SystemData `json:"systemData,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ConvertibleSpec = &WorkspacesComputes_Spec{}
// ConvertSpecFrom populates our WorkspacesComputes_Spec from the provided source
func (computes *WorkspacesComputes_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
if source == computes {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return source.ConvertSpecTo(computes)
}
// ConvertSpecTo populates the provided destination from our WorkspacesComputes_Spec
func (computes *WorkspacesComputes_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
if destination == computes {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return destination.ConvertSpecFrom(computes)
}
// Storage version of v1beta20210701.Compute
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Compute
type Compute struct {
AKS *Compute_AKS `json:"aks,omitempty"`
AmlCompute *Compute_AmlCompute `json:"amlCompute,omitempty"`
ComputeInstance *Compute_ComputeInstance `json:"computeInstance,omitempty"`
DataFactory *Compute_DataFactory `json:"dataFactory,omitempty"`
DataLakeAnalytics *Compute_DataLakeAnalytics `json:"dataLakeAnalytics,omitempty"`
Databricks *Compute_Databricks `json:"databricks,omitempty"`
HDInsight *Compute_HDInsight `json:"hdInsight,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SynapseSpark *Compute_SynapseSpark `json:"synapseSpark,omitempty"`
VirtualMachine *Compute_VirtualMachine `json:"virtualMachine,omitempty"`
}
// Storage version of v1beta20210701.Compute_Status
type Compute_Status struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
CreatedOn *string `json:"createdOn,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
ModifiedOn *string `json:"modifiedOn,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ProvisioningErrors []ErrorResponse_Status `json:"provisioningErrors,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
}
// Storage version of v1beta20210701.Compute_AKS
type Compute_AKS struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *AKSProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_AmlCompute
type Compute_AmlCompute struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *AmlComputeProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_ComputeInstance
type Compute_ComputeInstance struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *ComputeInstanceProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_DataFactory
type Compute_DataFactory struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_DataLakeAnalytics
type Compute_DataLakeAnalytics struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_Databricks
type Compute_Databricks struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *DatabricksProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_HDInsight
type Compute_HDInsight struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *HDInsightProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_SynapseSpark
type Compute_SynapseSpark struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *SynapseSparkProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.Compute_VirtualMachine
type Compute_VirtualMachine struct {
ComputeLocation *string `json:"computeLocation,omitempty"`
ComputeType *string `json:"computeType,omitempty"`
Description *string `json:"description,omitempty"`
DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
Properties *VirtualMachineProperties `json:"properties,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// ResourceReference: ARM resource id of the underlying compute
ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}
// Storage version of v1beta20210701.ErrorResponse_Status
type ErrorResponse_Status struct {
Error *ErrorDetail_Status `json:"error,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.AKSProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AKSProperties
type AKSProperties struct {
AgentCount *int `json:"agentCount,omitempty"`
AgentVmSize *string `json:"agentVmSize,omitempty"`
AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"`
ClusterFqdn *string `json:"clusterFqdn,omitempty"`
ClusterPurpose *string `json:"clusterPurpose,omitempty"`
LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"`
LoadBalancerType *string `json:"loadBalancerType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"`
}
// Storage version of v1beta20210701.AmlComputeProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AmlComputeProperties
type AmlComputeProperties struct {
EnableNodePublicIp *bool `json:"enableNodePublicIp,omitempty"`
IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"`
OsType *string `json:"osType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RemoteLoginPortPublicAccess *string `json:"remoteLoginPortPublicAccess,omitempty"`
ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"`
Subnet *ResourceId `json:"subnet,omitempty"`
UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"`
VirtualMachineImage *VirtualMachineImage `json:"virtualMachineImage,omitempty"`
VmPriority *string `json:"vmPriority,omitempty"`
VmSize *string `json:"vmSize,omitempty"`
}
// Storage version of v1beta20210701.ComputeInstanceProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceProperties
type ComputeInstanceProperties struct {
ApplicationSharingPolicy *string `json:"applicationSharingPolicy,omitempty"`
ComputeInstanceAuthorizationType *string `json:"computeInstanceAuthorizationType,omitempty"`
PersonalComputeInstanceSettings *PersonalComputeInstanceSettings `json:"personalComputeInstanceSettings,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SetupScripts *SetupScripts `json:"setupScripts,omitempty"`
SshSettings *ComputeInstanceSshSettings `json:"sshSettings,omitempty"`
Subnet *ResourceId `json:"subnet,omitempty"`
VmSize *string `json:"vmSize,omitempty"`
}
// Storage version of v1beta20210701.DataLakeAnalyticsProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DataLakeAnalyticsProperties
type DataLakeAnalyticsProperties struct {
DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.DatabricksProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DatabricksProperties
type DatabricksProperties struct {
DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
WorkspaceUrl *string `json:"workspaceUrl,omitempty"`
}
// Storage version of v1beta20210701.ErrorDetail_Status
type ErrorDetail_Status struct {
AdditionalInfo []ErrorAdditionalInfo_Status `json:"additionalInfo,omitempty"`
Code *string `json:"code,omitempty"`
Details []ErrorDetail_Status_Unrolled `json:"details,omitempty"`
Message *string `json:"message,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Target *string `json:"target,omitempty"`
}
// Storage version of v1beta20210701.HDInsightProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/HDInsightProperties
type HDInsightProperties struct {
Address *string `json:"address,omitempty"`
AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SshPort *int `json:"sshPort,omitempty"`
}
// Storage version of v1beta20210701.SynapseSparkProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SynapseSparkProperties
type SynapseSparkProperties struct {
AutoPauseProperties *AutoPauseProperties `json:"autoPauseProperties,omitempty"`
AutoScaleProperties *AutoScaleProperties `json:"autoScaleProperties,omitempty"`
NodeCount *int `json:"nodeCount,omitempty"`
NodeSize *string `json:"nodeSize,omitempty"`
NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"`
PoolName *string `json:"poolName,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ResourceGroup *string `json:"resourceGroup,omitempty"`
SparkVersion *string `json:"sparkVersion,omitempty"`
SubscriptionId *string `json:"subscriptionId,omitempty"`
WorkspaceName *string `json:"workspaceName,omitempty"`
}
// Storage version of v1beta20210701.VirtualMachineProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineProperties
type VirtualMachineProperties struct {
Address *string `json:"address,omitempty"`
AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"`
IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SshPort *int `json:"sshPort,omitempty"`
VirtualMachineSize *string `json:"virtualMachineSize,omitempty"`
}
// Storage version of v1beta20210701.AksNetworkingConfiguration
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AksNetworkingConfiguration
type AksNetworkingConfiguration struct {
DnsServiceIP *string `json:"dnsServiceIP,omitempty"`
DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ServiceCidr *string `json:"serviceCidr,omitempty"`
// SubnetReference: Virtual network subnet resource ID the compute nodes belong to
SubnetReference *genruntime.ResourceReference `armReference:"SubnetId" json:"subnetReference,omitempty"`
}
// Storage version of v1beta20210701.AutoPauseProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoPauseProperties
type AutoPauseProperties struct {
DelayInMinutes *int `json:"delayInMinutes,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.AutoScaleProperties
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoScaleProperties
type AutoScaleProperties struct {
Enabled *bool `json:"enabled,omitempty"`
MaxNodeCount *int `json:"maxNodeCount,omitempty"`
MinNodeCount *int `json:"minNodeCount,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.ComputeInstanceSshSettings
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceSshSettings
type ComputeInstanceSshSettings struct {
AdminPublicKey *string `json:"adminPublicKey,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SshPublicAccess *string `json:"sshPublicAccess,omitempty"`
}
// Storage version of v1beta20210701.ErrorAdditionalInfo_Status
type ErrorAdditionalInfo_Status struct {
Info map[string]v1.JSON `json:"info,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Type *string `json:"type,omitempty"`
}
// Storage version of v1beta20210701.ErrorDetail_Status_Unrolled
type ErrorDetail_Status_Unrolled struct {
AdditionalInfo []ErrorAdditionalInfo_Status `json:"additionalInfo,omitempty"`
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Target *string `json:"target,omitempty"`
}
// Storage version of v1beta20210701.PersonalComputeInstanceSettings
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/PersonalComputeInstanceSettings
type PersonalComputeInstanceSettings struct {
AssignedUser *AssignedUser `json:"assignedUser,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.ResourceId
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ResourceId
type ResourceId struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// +kubebuilder:validation:Required
// Reference: The ID of the resource
Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}
// Storage version of v1beta20210701.ScaleSettings
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScaleSettings
type ScaleSettings struct {
MaxNodeCount *int `json:"maxNodeCount,omitempty"`
MinNodeCount *int `json:"minNodeCount,omitempty"`
NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.SetupScripts
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SetupScripts
type SetupScripts struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Scripts *ScriptsToExecute `json:"scripts,omitempty"`
}
// Storage version of v1beta20210701.SslConfiguration
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SslConfiguration
type SslConfiguration struct {
Cert *string `json:"cert,omitempty"`
Cname *string `json:"cname,omitempty"`
Key *string `json:"key,omitempty"`
LeafDomainLabel *string `json:"leafDomainLabel,omitempty"`
OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Status *string `json:"status,omitempty"`
}
// Storage version of v1beta20210701.UserAccountCredentials
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/UserAccountCredentials
type UserAccountCredentials struct {
AdminUserName *string `json:"adminUserName,omitempty"`
AdminUserPassword *genruntime.SecretReference `json:"adminUserPassword,omitempty"`
AdminUserSshPublicKey *genruntime.SecretReference `json:"adminUserSshPublicKey,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1beta20210701.VirtualMachineImage
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineImage
type VirtualMachineImage struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// +kubebuilder:validation:Required
// Reference: Virtual Machine image path
Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}
// Storage version of v1beta20210701.VirtualMachineSshCredentials
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineSshCredentials
type VirtualMachineSshCredentials struct {
Password *genruntime.SecretReference `json:"password,omitempty"`
PrivateKeyData *string `json:"privateKeyData,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
PublicKeyData *string `json:"publicKeyData,omitempty"`
Username *string `json:"username,omitempty"`
}
// Storage version of v1beta20210701.AssignedUser
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AssignedUser
type AssignedUser struct {
ObjectId *string `json:"objectId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
TenantId *string `json:"tenantId,omitempty"`
}
// Storage version of v1beta20210701.ScriptsToExecute
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptsToExecute
type ScriptsToExecute struct {
CreationScript *ScriptReference `json:"creationScript,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
StartupScript *ScriptReference `json:"startupScript,omitempty"`
}
// Storage version of v1beta20210701.ScriptReference
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptReference
type ScriptReference struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ScriptArguments *string `json:"scriptArguments,omitempty"`
ScriptData *string `json:"scriptData,omitempty"`
ScriptSource *string `json:"scriptSource,omitempty"`
Timeout *string `json:"timeout,omitempty"`
}
func init() {
SchemeBuilder.Register(&WorkspacesCompute{}, &WorkspacesComputeList{})
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,211 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701storage
import (
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources=workspacesconnections,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources={workspacesconnections/status,workspacesconnections/finalizers},verbs=get;update;patch
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1beta20210701.WorkspacesConnection
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections
type WorkspacesConnection struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkspacesConnections_Spec `json:"spec,omitempty"`
Status WorkspaceConnection_Status `json:"status,omitempty"`
}
var _ conditions.Conditioner = &WorkspacesConnection{}
// GetConditions returns the conditions of the resource
func (connection *WorkspacesConnection) GetConditions() conditions.Conditions {
return connection.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (connection *WorkspacesConnection) SetConditions(conditions conditions.Conditions) {
connection.Status.Conditions = conditions
}
var _ genruntime.KubernetesResource = &WorkspacesConnection{}
// AzureName returns the Azure name of the resource
func (connection *WorkspacesConnection) AzureName() string {
return connection.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01"
func (connection WorkspacesConnection) GetAPIVersion() string {
return string(APIVersionValue)
}
// GetResourceKind returns the kind of the resource
func (connection *WorkspacesConnection) GetResourceKind() genruntime.ResourceKind {
return genruntime.ResourceKindNormal
}
// GetSpec returns the specification of this resource
func (connection *WorkspacesConnection) GetSpec() genruntime.ConvertibleSpec {
return &connection.Spec
}
// GetStatus returns the status of this resource
func (connection *WorkspacesConnection) GetStatus() genruntime.ConvertibleStatus {
return &connection.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/connections"
func (connection *WorkspacesConnection) GetType() string {
return "Microsoft.MachineLearningServices/workspaces/connections"
}
// NewEmptyStatus returns a new empty (blank) status
func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleStatus {
return &WorkspaceConnection_Status{}
}
// Owner returns the ResourceReference of the owner, or nil if there is no owner
func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(connection.Spec)
return &genruntime.ResourceReference{
Group: group,
Kind: kind,
Name: connection.Spec.Owner.Name,
}
}
// SetStatus sets the status of this resource
func (connection *WorkspacesConnection) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*WorkspaceConnection_Status); ok {
connection.Status = *st
return nil
}
// Convert status to required version
var st WorkspaceConnection_Status
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
connection.Status = st
return nil
}
// Hub marks that this WorkspacesConnection is the hub type for conversion
func (connection *WorkspacesConnection) Hub() {}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (connection *WorkspacesConnection) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: connection.Spec.OriginalVersion,
Kind: "WorkspacesConnection",
}
}
// +kubebuilder:object:root=true
// Storage version of v1beta20210701.WorkspacesConnection
// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections
type WorkspacesConnectionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkspacesConnection `json:"items"`
}
// Storage version of v1beta20210701.WorkspaceConnection_Status
type WorkspaceConnection_Status struct {
AuthType *string `json:"authType,omitempty"`
Category *string `json:"category,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Target *string `json:"target,omitempty"`
Type *string `json:"type,omitempty"`
Value *string `json:"value,omitempty"`
ValueFormat *string `json:"valueFormat,omitempty"`
}
var _ genruntime.ConvertibleStatus = &WorkspaceConnection_Status{}
// ConvertStatusFrom populates our WorkspaceConnection_Status from the provided source
func (connection *WorkspaceConnection_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
if source == connection {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return source.ConvertStatusTo(connection)
}
// ConvertStatusTo populates the provided destination from our WorkspaceConnection_Status
func (connection *WorkspaceConnection_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
if destination == connection {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return destination.ConvertStatusFrom(connection)
}
// Storage version of v1beta20210701.WorkspacesConnections_Spec
type WorkspacesConnections_Spec struct {
AuthType *string `json:"authType,omitempty"`
// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
// doesn't have to be.
AzureName string `json:"azureName,omitempty"`
Category *string `json:"category,omitempty"`
Location *string `json:"location,omitempty"`
OriginalVersion string `json:"originalVersion,omitempty"`
// +kubebuilder:validation:Required
// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
// reference to a machinelearningservices.azure.com/Workspace resource
Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Target *string `json:"target,omitempty"`
Value *string `json:"value,omitempty"`
ValueFormat *string `json:"valueFormat,omitempty"`
}
var _ genruntime.ConvertibleSpec = &WorkspacesConnections_Spec{}
// ConvertSpecFrom populates our WorkspacesConnections_Spec from the provided source
func (connections *WorkspacesConnections_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
if source == connections {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return source.ConvertSpecTo(connections)
}
// ConvertSpecTo populates the provided destination from our WorkspacesConnections_Spec
func (connections *WorkspacesConnections_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
if destination == connections {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return destination.ConvertSpecFrom(connections)
}
func init() {
SchemeBuilder.Register(&WorkspacesConnection{}, &WorkspacesConnectionList{})
}

Просмотреть файл

@ -0,0 +1,214 @@
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210701storage
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kr/pretty"
"github.com/kylelemons/godebug/diff"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"os"
"reflect"
"testing"
)
func Test_WorkspacesConnection_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspacesConnection via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesConnection, WorkspacesConnectionGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesConnection runs a test to see if a specific instance of WorkspacesConnection round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesConnection(subject WorkspacesConnection) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspacesConnection
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspacesConnection instances for property testing - lazily instantiated by
// WorkspacesConnectionGenerator()
var workspacesConnectionGenerator gopter.Gen
// WorkspacesConnectionGenerator returns a generator of WorkspacesConnection instances for property testing.
func WorkspacesConnectionGenerator() gopter.Gen {
if workspacesConnectionGenerator != nil {
return workspacesConnectionGenerator
}
generators := make(map[string]gopter.Gen)
AddRelatedPropertyGeneratorsForWorkspacesConnection(generators)
workspacesConnectionGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnection{}), generators)
return workspacesConnectionGenerator
}
// AddRelatedPropertyGeneratorsForWorkspacesConnection is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesConnection(gens map[string]gopter.Gen) {
gens["Spec"] = WorkspacesConnectionsSpecGenerator()
gens["Status"] = WorkspaceConnectionStatusGenerator()
}
func Test_WorkspaceConnection_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspaceConnection_Status via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionStatus, WorkspaceConnectionStatusGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspaceConnectionStatus runs a test to see if a specific instance of WorkspaceConnection_Status round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspaceConnectionStatus(subject WorkspaceConnection_Status) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspaceConnection_Status
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspaceConnection_Status instances for property testing - lazily instantiated by
// WorkspaceConnectionStatusGenerator()
var workspaceConnectionStatusGenerator gopter.Gen
// WorkspaceConnectionStatusGenerator returns a generator of WorkspaceConnection_Status instances for property testing.
func WorkspaceConnectionStatusGenerator() gopter.Gen {
if workspaceConnectionStatusGenerator != nil {
return workspaceConnectionStatusGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(generators)
workspaceConnectionStatusGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_Status{}), generators)
return workspaceConnectionStatusGenerator
}
// AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(gens map[string]gopter.Gen) {
gens["AuthType"] = gen.PtrOf(gen.AlphaString())
gens["Category"] = gen.PtrOf(gen.AlphaString())
gens["Id"] = gen.PtrOf(gen.AlphaString())
gens["Name"] = gen.PtrOf(gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
gens["Type"] = gen.PtrOf(gen.AlphaString())
gens["Value"] = gen.PtrOf(gen.AlphaString())
gens["ValueFormat"] = gen.PtrOf(gen.AlphaString())
}
func Test_WorkspacesConnections_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
t.Parallel()
parameters := gopter.DefaultTestParameters()
parameters.MaxSize = 10
properties := gopter.NewProperties(parameters)
properties.Property(
"Round trip of WorkspacesConnections_Spec via JSON returns original",
prop.ForAll(RunJSONSerializationTestForWorkspacesConnectionsSpec, WorkspacesConnectionsSpecGenerator()))
properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}
// RunJSONSerializationTestForWorkspacesConnectionsSpec runs a test to see if a specific instance of WorkspacesConnections_Spec round trips to JSON and back losslessly
func RunJSONSerializationTestForWorkspacesConnectionsSpec(subject WorkspacesConnections_Spec) string {
// Serialize to JSON
bin, err := json.Marshal(subject)
if err != nil {
return err.Error()
}
// Deserialize back into memory
var actual WorkspacesConnections_Spec
err = json.Unmarshal(bin, &actual)
if err != nil {
return err.Error()
}
// Check for outcome
match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
if !match {
actualFmt := pretty.Sprint(actual)
subjectFmt := pretty.Sprint(subject)
result := diff.Diff(subjectFmt, actualFmt)
return result
}
return ""
}
// Generator of WorkspacesConnections_Spec instances for property testing - lazily instantiated by
// WorkspacesConnectionsSpecGenerator()
var workspacesConnectionsSpecGenerator gopter.Gen
// WorkspacesConnectionsSpecGenerator returns a generator of WorkspacesConnections_Spec instances for property testing.
func WorkspacesConnectionsSpecGenerator() gopter.Gen {
if workspacesConnectionsSpecGenerator != nil {
return workspacesConnectionsSpecGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(generators)
workspacesConnectionsSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_Spec{}), generators)
return workspacesConnectionsSpecGenerator
}
// AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(gens map[string]gopter.Gen) {
gens["AuthType"] = gen.PtrOf(gen.AlphaString())
gens["AzureName"] = gen.AlphaString()
gens["Category"] = gen.PtrOf(gen.AlphaString())
gens["Location"] = gen.PtrOf(gen.AlphaString())
gens["OriginalVersion"] = gen.AlphaString()
gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())
gens["Target"] = gen.PtrOf(gen.AlphaString())
gens["Value"] = gen.PtrOf(gen.AlphaString())
gens["ValueFormat"] = gen.PtrOf(gen.AlphaString())
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,113 @@
| Type Definitions in package "machinelearningservices" | v1beta20210701 |
|-----------------------------------------------------------|----------------|
| AKSProperties | v1beta20210701 |
| AKSPropertiesClusterPurpose | v1beta20210701 |
| AKSPropertiesLoadBalancerType | v1beta20210701 |
| APIVersion | v1beta20210701 |
| AksNetworkingConfiguration | v1beta20210701 |
| AmlComputeProperties | v1beta20210701 |
| AmlComputePropertiesOsType | v1beta20210701 |
| AmlComputePropertiesRemoteLoginPortPublicAccess | v1beta20210701 |
| AmlComputePropertiesVmPriority | v1beta20210701 |
| AssignedUser | v1beta20210701 |
| AutoPauseProperties | v1beta20210701 |
| AutoScaleProperties | v1beta20210701 |
| Compute | v1beta20210701 |
| ComputeAKSComputeType | v1beta20210701 |
| ComputeAmlComputeComputeType | v1beta20210701 |
| ComputeComputeInstanceComputeType | v1beta20210701 |
| ComputeDataFactoryComputeType | v1beta20210701 |
| ComputeDataLakeAnalyticsComputeType | v1beta20210701 |
| ComputeDatabricksComputeType | v1beta20210701 |
| ComputeHDInsightComputeType | v1beta20210701 |
| ComputeInstanceProperties | v1beta20210701 |
| ComputeInstancePropertiesApplicationSharingPolicy | v1beta20210701 |
| ComputeInstancePropertiesComputeInstanceAuthorizationType | v1beta20210701 |
| ComputeInstanceSshSettings | v1beta20210701 |
| ComputeInstanceSshSettingsSshPublicAccess | v1beta20210701 |
| ComputeResource_Status | v1beta20210701 |
| ComputeStatusProvisioningState | v1beta20210701 |
| ComputeSynapseSparkComputeType | v1beta20210701 |
| ComputeType_Status | v1beta20210701 |
| ComputeVirtualMachineComputeType | v1beta20210701 |
| Compute_AKS | v1beta20210701 |
| Compute_AmlCompute | v1beta20210701 |
| Compute_ComputeInstance | v1beta20210701 |
| Compute_DataFactory | v1beta20210701 |
| Compute_DataLakeAnalytics | v1beta20210701 |
| Compute_Databricks | v1beta20210701 |
| Compute_HDInsight | v1beta20210701 |
| Compute_Status | v1beta20210701 |
| Compute_SynapseSpark | v1beta20210701 |
| Compute_VirtualMachine | v1beta20210701 |
| CosmosDbSettings | v1beta20210701 |
| CosmosDbSettings_Status | v1beta20210701 |
| DataLakeAnalyticsProperties | v1beta20210701 |
| DatabricksProperties | v1beta20210701 |
| EncryptionProperty | v1beta20210701 |
| EncryptionPropertyStatus | v1beta20210701 |
| EncryptionPropertyStatusStatus | v1beta20210701 |
| EncryptionProperty_Status | v1beta20210701 |
| ErrorAdditionalInfo_Status | v1beta20210701 |
| ErrorDetail_Status | v1beta20210701 |
| ErrorDetail_Status_Unrolled | v1beta20210701 |
| ErrorResponse_Status | v1beta20210701 |
| HDInsightProperties | v1beta20210701 |
| Identity | v1beta20210701 |
| IdentityForCmk | v1beta20210701 |
| IdentityForCmk_Status | v1beta20210701 |
| IdentityStatusType | v1beta20210701 |
| IdentityType | v1beta20210701 |
| Identity_Status | v1beta20210701 |
| KeyVaultProperties | v1beta20210701 |
| KeyVaultProperties_Status | v1beta20210701 |
| NotebookPreparationError_Status | v1beta20210701 |
| NotebookResourceInfo_Status | v1beta20210701 |
| PersonalComputeInstanceSettings | v1beta20210701 |
| PrivateEndpointConnection_Status_SubResourceEmbedded | v1beta20210701 |
| PrivateEndpointServiceConnectionStatus_Status | v1beta20210701 |
| ResourceId | v1beta20210701 |
| ScaleSettings | v1beta20210701 |
| ScriptReference | v1beta20210701 |
| ScriptsToExecute | v1beta20210701 |
| ServiceManagedResourcesSettings | v1beta20210701 |
| ServiceManagedResourcesSettings_Status | v1beta20210701 |
| SetupScripts | v1beta20210701 |
| SharedPrivateLinkResourceProperty | v1beta20210701 |
| SharedPrivateLinkResourcePropertyStatus | v1beta20210701 |
| SharedPrivateLinkResourceProperty_Status | v1beta20210701 |
| SharedPrivateLinkResource_Status | v1beta20210701 |
| Sku | v1beta20210701 |
| Sku_Status | v1beta20210701 |
| SslConfiguration | v1beta20210701 |
| SslConfigurationStatus | v1beta20210701 |
| SynapseSparkProperties | v1beta20210701 |
| SystemData | v1beta20210701 |
| SystemDataCreatedByType | v1beta20210701 |
| SystemDataLastModifiedByType | v1beta20210701 |
| SystemDataStatusCreatedByType | v1beta20210701 |
| SystemDataStatusLastModifiedByType | v1beta20210701 |
| SystemData_Status | v1beta20210701 |
| UserAccountCredentials | v1beta20210701 |
| UserAssignedIdentity_Status | v1beta20210701 |
| VirtualMachineImage | v1beta20210701 |
| VirtualMachineProperties | v1beta20210701 |
| VirtualMachineSshCredentials | v1beta20210701 |
| Workspace | v1beta20210701 |
| WorkspaceConnectionProps | v1beta20210701 |
| WorkspaceConnectionPropsStatusValueFormat | v1beta20210701 |
| WorkspaceConnectionPropsValueFormat | v1beta20210701 |
| WorkspaceConnectionProps_Status | v1beta20210701 |
| WorkspaceConnection_Status | v1beta20210701 |
| WorkspacePropertiesStatusProvisioningState | v1beta20210701 |
| WorkspacePropertiesStatusPublicNetworkAccess | v1beta20210701 |
| WorkspaceProperties_Status | v1beta20210701 |
| Workspace_Status | v1beta20210701 |
| WorkspacesCompute | v1beta20210701 |
| WorkspacesComputes_Spec | v1beta20210701 |
| WorkspacesConnection | v1beta20210701 |
| WorkspacesConnections_Spec | v1beta20210701 |
| WorkspacesSpecPropertiesPublicNetworkAccess | v1beta20210701 |
| Workspaces_Spec | v1beta20210701 |
| Workspaces_Spec_Properties | v1beta20210701 |
| Workspaces_Spec_Properties_SharedPrivateLinkResources | v1beta20210701 |

Просмотреть файл

@ -1039,6 +1039,83 @@ objectModelConfiguration:
UserAssignedIdentity:
$export: true
$supportedFrom: v2.0.0-alpha.1
machinelearningservices:
2021-07-01:
Workspace:
$export: true
$supportedFrom: v2.0.0-beta.2
$azureGeneratedSecrets:
- AppInsightsInstrumentationKey
- ContainerRegistryUserName
- ContainerRegistryPassword
- ContainerRegistryPassword2
- PrimaryNotebookAccessKey
- SecondaryNotebookAccessKey
- UserStorageKey
Workspaces_Spec_Properties:
ApplicationInsights:
$armReference: true
PrimaryUserAssignedIdentity:
$armReference: true
StorageAccount:
$armReference: true
KeyVault:
$armReference: true
ContainerRegistry:
$armReference: true
SharedPrivateLinkResourceProperty:
PrivateLinkResourceId:
$armReference: true
WorkspacesCompute:
$export: true
$supportedFrom: v2.0.0-beta.2
VirtualMachineImage:
Id:
$armReference: true
Compute_HDInsight:
ResourceId:
$armReference: true
ResourceId:
Id:
$armReference: true
Compute_DataLakeAnalytics:
ResourceId:
$armReference: true
AksNetworkingConfiguration:
SubnetId:
$armReference: true
Compute_Databricks:
ResourceId:
$armReference: true
Compute_DataFactory:
ResourceId:
$armReference: true
Compute_AKS:
ResourceId:
$armReference: true
Compute_ComputeInstance:
ResourceId:
$armReference: true
Compute_SynapseSpark:
ResourceId:
$armReference: true
Compute_AmlCompute:
ResourceId:
$armReference: true
Compute_VirtualMachine:
ResourceId:
$armReference: true
UserAccountCredentials:
AdminUserPassword:
$isSecret: true
AdminUserSshPublicKey:
$isSecret: true
VirtualMachineSshCredentials:
Password:
$isSecret: true
WorkspacesConnection:
$export: true
$supportedFrom: v2.0.0-beta.2
network:
2020-11-01:
LoadBalancer:

Просмотреть файл

@ -0,0 +1,47 @@
apiVersion: machinelearningservices.azure.com/v1beta20210701
kind: Workspace
metadata:
name: sampleworkspaces
namespace: default
spec:
location: westcentralus
owner:
name: aso-sample-rg
sku:
name: Standard_S1
tier: Basic
allowPublicAccessWhenBehindVnet: false
identity:
type: SystemAssigned
storageAccountReference:
group: "storage.azure.com"
kind: "StorageAccount"
name: "samplekubestorage"
keyVaultReference:
group: "keyvault.azure.com"
kind: "Vault"
name: "samplevault"
# Optional: Save the keys for the storage account into a Kubernetes secret
operatorSpec:
secrets:
appInsightsInstrumentationKey:
name: workspace-secret
key: appInsightsInstrumentationKey
containerRegistryPassword:
name: workspace-secret
key: containerRegistryPassword
containerRegistryPassword2:
name: workspace-secret
key: containerRegistryPassword2
containerRegistryUserName:
name: workspace-secret
key: containerRegistryUserName
primaryNotebookAccessKey:
name: workspace-secret
key: primaryNotebookAccessKey
secondaryNotebookAccessKey:
name: workspace-secret
key: secondaryNotebookAccessKey
userStorageKey:
name: workspace-secret
key: userStorageKey

Просмотреть файл

@ -0,0 +1,25 @@
apiVersion: machinelearningservices.azure.com/v1beta20210701
kind: WorkspacesCompute
metadata:
name: sampleworkspacescompute
namespace: default
spec:
location: westcentralus
owner:
name: aso-sample-rg
sku:
name: Standard_S1
tier: Basic
properties:
virtualMachine:
computeLocation: westcentralus
computeType: VirtualMachine
disableLocalAuth: true
ResourceId: ""
properties:
sshPort: 22
administratorAccount:
username: admin
password: # This is the name/key of a Kubernetes secret in the same namespace
name: vm-admin-pw
key: password

Просмотреть файл

@ -0,0 +1,14 @@
apiVersion: machinelearningservices.azure.com/v1beta20210701
kind: WorkspacesConnection
metadata:
name: sampleworkspacesconnection
namespace: default
spec:
location: westcentralus
owner:
name: aso-sample-rg
authType: PAT
category: ACR
target: www.sample.com
value: "{}"
valueFormat: JSON

Просмотреть файл

@ -7,6 +7,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.0.0
github.com/Azure/go-autorest/autorest/to v0.4.0

Просмотреть файл

@ -49,6 +49,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontai
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 h1:Fv8iibGn1eSw0lt2V3cTsuokBEnOP+M//n8OiMcCgTM=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0/go.mod h1:Qpe/qN9d5IQ7WPtTXMRCd6+BWTnhi3sxXVys6oJ5Vho=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0 h1:KWvCVjnOTKCZAlqED5KPNoN9AfcK2BhUeveLdiwy33Q=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0/go.mod h1:qNN4I5AKYbXMLriS9XKebBw8EVIQkX6tJzrdtjOoJ4I=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis v1.0.0 h1:nmpTBgRg1HynngFYICRhceC7s5dmbKN9fJ/XQz/UQ2I=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis v1.0.0/go.mod h1:3yjiOtnkVociBTlF7UZrwAGfJrGaOCsvtVS4HzNajxQ=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=

Просмотреть файл

@ -14,6 +14,7 @@ import (
const (
SubscriptionIDVar = "AZURE_SUBSCRIPTION_ID"
TenantIDVar = "AZURE_TENANT_ID"
targetNamespacesVar = "AZURE_TARGET_NAMESPACES"
operatorModeVar = "AZURE_OPERATOR_MODE"
syncPeriodVar = "AZURE_SYNC_PERIOD"

Просмотреть файл

@ -92,6 +92,9 @@ import (
keyvault_customizations "github.com/Azure/azure-service-operator/v2/api/keyvault/customizations"
keyvault_v20210401p "github.com/Azure/azure-service-operator/v2/api/keyvault/v1beta20210401preview"
keyvault_v20210401ps "github.com/Azure/azure-service-operator/v2/api/keyvault/v1beta20210401previewstorage"
machinelearningservices_customizations "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/customizations"
machinelearningservices_v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701"
machinelearningservices_v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage"
managedidentity_customizations "github.com/Azure/azure-service-operator/v2/api/managedidentity/customizations"
managedidentity_alpha20181130 "github.com/Azure/azure-service-operator/v2/api/managedidentity/v1alpha1api20181130"
managedidentity_alpha20181130s "github.com/Azure/azure-service-operator/v2/api/managedidentity/v1alpha1api20181130storage"
@ -459,6 +462,43 @@ func getKnownStorageTypes() []*registration.StorageType {
Indexes: []registration.Index{},
Watches: []registration.Watch{},
})
result = append(result, &registration.StorageType{
Obj: new(machinelearningservices_v20210701s.Workspace),
Indexes: []registration.Index{},
Watches: []registration.Watch{},
})
result = append(result, &registration.StorageType{
Obj: new(machinelearningservices_v20210701s.WorkspacesCompute),
Indexes: []registration.Index{
{
Key: ".spec.properties.amlCompute.properties.userAccountCredentials.adminUserPassword",
Func: indexMachinelearningservicesWorkspacesComputeAdminUserPassword,
},
{
Key: ".spec.properties.amlCompute.properties.userAccountCredentials.adminUserSshPublicKey",
Func: indexMachinelearningservicesWorkspacesComputeAdminUserSshPublicKey,
},
{
Key: ".spec.properties.hdInsight.properties.administratorAccount.password",
Func: indexMachinelearningservicesWorkspacesComputeHDInsightPassword,
},
{
Key: ".spec.properties.virtualMachine.properties.administratorAccount.password",
Func: indexMachinelearningservicesWorkspacesComputeVirtualMachinePassword,
},
},
Watches: []registration.Watch{
{
Src: &source.Kind{Type: &v1.Secret{}},
MakeEventHandler: watchSecretsFactory([]string{".spec.properties.amlCompute.properties.userAccountCredentials.adminUserPassword", ".spec.properties.amlCompute.properties.userAccountCredentials.adminUserSshPublicKey", ".spec.properties.hdInsight.properties.administratorAccount.password", ".spec.properties.virtualMachine.properties.administratorAccount.password"}, &machinelearningservices_v20210701s.WorkspacesComputeList{}),
},
},
})
result = append(result, &registration.StorageType{
Obj: new(machinelearningservices_v20210701s.WorkspacesConnection),
Indexes: []registration.Index{},
Watches: []registration.Watch{},
})
result = append(result, &registration.StorageType{
Obj: new(managedidentity_v20181130s.UserAssignedIdentity),
Indexes: []registration.Index{},
@ -778,6 +818,12 @@ func getKnownTypes() []client.Object {
result = append(result, new(insights_v20200202s.Component))
result = append(result, new(keyvault_v20210401p.Vault))
result = append(result, new(keyvault_v20210401ps.Vault))
result = append(result, new(machinelearningservices_v20210701.Workspace))
result = append(result, new(machinelearningservices_v20210701.WorkspacesCompute))
result = append(result, new(machinelearningservices_v20210701.WorkspacesConnection))
result = append(result, new(machinelearningservices_v20210701s.Workspace))
result = append(result, new(machinelearningservices_v20210701s.WorkspacesCompute))
result = append(result, new(machinelearningservices_v20210701s.WorkspacesConnection))
result = append(result, new(managedidentity_alpha20181130.UserAssignedIdentity))
result = append(result, new(managedidentity_alpha20181130s.UserAssignedIdentity))
result = append(result, new(managedidentity_v20181130.UserAssignedIdentity))
@ -945,6 +991,8 @@ func createScheme() *runtime.Scheme {
_ = insights_v20200202s.AddToScheme(scheme)
_ = keyvault_v20210401p.AddToScheme(scheme)
_ = keyvault_v20210401ps.AddToScheme(scheme)
_ = machinelearningservices_v20210701.AddToScheme(scheme)
_ = machinelearningservices_v20210701s.AddToScheme(scheme)
_ = managedidentity_alpha20181130.AddToScheme(scheme)
_ = managedidentity_alpha20181130s.AddToScheme(scheme)
_ = managedidentity_v20181130.AddToScheme(scheme)
@ -1028,6 +1076,9 @@ func getResourceExtensions() []genruntime.ResourceExtension {
result = append(result, &insights_customizations.ComponentExtension{})
result = append(result, &insights_customizations.WebtestExtension{})
result = append(result, &keyvault_customizations.VaultExtension{})
result = append(result, &machinelearningservices_customizations.WorkspaceExtension{})
result = append(result, &machinelearningservices_customizations.WorkspacesComputeExtension{})
result = append(result, &machinelearningservices_customizations.WorkspacesConnectionExtension{})
result = append(result, &managedidentity_customizations.UserAssignedIdentityExtension{})
result = append(result, &network_customizations.LoadBalancerExtension{})
result = append(result, &network_customizations.NetworkInterfaceExtension{})
@ -1144,3 +1195,99 @@ func indexDbforpostgresqlFlexibleServerAdministratorLoginPassword(rawObj client.
}
return []string{obj.Spec.AdministratorLoginPassword.Name}
}
// indexMachinelearningservicesWorkspacesComputeAdminUserPassword an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.amlCompute.properties.userAccountCredentials.adminUserPassword
func indexMachinelearningservicesWorkspacesComputeAdminUserPassword(rawObj client.Object) []string {
obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute)
if !ok {
return nil
}
if obj.Spec.Properties == nil {
return nil
}
if obj.Spec.Properties.AmlCompute == nil {
return nil
}
if obj.Spec.Properties.AmlCompute.Properties == nil {
return nil
}
if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials == nil {
return nil
}
if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserPassword == nil {
return nil
}
return []string{obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserPassword.Name}
}
// indexMachinelearningservicesWorkspacesComputeAdminUserSshPublicKey an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.amlCompute.properties.userAccountCredentials.adminUserSshPublicKey
func indexMachinelearningservicesWorkspacesComputeAdminUserSshPublicKey(rawObj client.Object) []string {
obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute)
if !ok {
return nil
}
if obj.Spec.Properties == nil {
return nil
}
if obj.Spec.Properties.AmlCompute == nil {
return nil
}
if obj.Spec.Properties.AmlCompute.Properties == nil {
return nil
}
if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials == nil {
return nil
}
if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserSshPublicKey == nil {
return nil
}
return []string{obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserSshPublicKey.Name}
}
// indexMachinelearningservicesWorkspacesComputeHDInsightPassword an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.hdInsight.properties.administratorAccount.password
func indexMachinelearningservicesWorkspacesComputeHDInsightPassword(rawObj client.Object) []string {
obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute)
if !ok {
return nil
}
if obj.Spec.Properties == nil {
return nil
}
if obj.Spec.Properties.HDInsight == nil {
return nil
}
if obj.Spec.Properties.HDInsight.Properties == nil {
return nil
}
if obj.Spec.Properties.HDInsight.Properties.AdministratorAccount == nil {
return nil
}
if obj.Spec.Properties.HDInsight.Properties.AdministratorAccount.Password == nil {
return nil
}
return []string{obj.Spec.Properties.HDInsight.Properties.AdministratorAccount.Password.Name}
}
// indexMachinelearningservicesWorkspacesComputeVirtualMachinePassword an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.virtualMachine.properties.administratorAccount.password
func indexMachinelearningservicesWorkspacesComputeVirtualMachinePassword(rawObj client.Object) []string {
obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute)
if !ok {
return nil
}
if obj.Spec.Properties == nil {
return nil
}
if obj.Spec.Properties.VirtualMachine == nil {
return nil
}
if obj.Spec.Properties.VirtualMachine.Properties == nil {
return nil
}
if obj.Spec.Properties.VirtualMachine.Properties.AdministratorAccount == nil {
return nil
}
if obj.Spec.Properties.VirtualMachine.Properties.AdministratorAccount.Password == nil {
return nil
}
return []string{obj.Spec.Properties.VirtualMachine.Properties.AdministratorAccount.Password.Name}
}

Просмотреть файл

@ -235,9 +235,16 @@ func Test_Compute_VMSS_CRUD(t *testing.T) {
tc.PatchResourceAndWait(old, vmss)
tc.Expect(vmss.Status.VirtualMachineProfile).ToNot(BeNil())
tc.Expect(vmss.Status.VirtualMachineProfile.ExtensionProfile).ToNot(BeNil())
tc.Expect(vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions).To(HaveLen(1))
tc.Expect(vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions[0].Name).ToNot(BeNil())
tc.Expect(*vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions[0].Name).To(Equal(extensionName))
tc.Expect(len(vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions)).To(BeNumerically(">", 0))
found := false
for _, extension := range vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions {
tc.Expect(extension.Name).ToNot(BeNil())
if *extension.Name == extensionName {
found = true
}
}
tc.Expect(found).To(BeTrue())
// Delete VMSS
tc.DeleteResourceAndWait(vmss)

Просмотреть файл

@ -35,33 +35,28 @@ func newVault(tc *testcommon.KubePerTestContext, rg *resources.ResourceGroup) *k
skuFamily := keyvault.SkuFamilyA
skuName := keyvault.SkuNameStandard
//TODO: This value here is a random generated string to comply with `^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$` regex.
// Tried random generator here which gets stored in the recordings and going to differ on each run resulting in test failure.
// We kinda need some static value here
str := "1C793267-c310-d4ae-7BD5-5Af5BEF875D3"
return &keyvault.Vault{
ObjectMeta: tc.MakeObjectMeta("keyvau"),
ObjectMeta: tc.MakeObjectMeta("keyvault"),
Spec: keyvault.Vaults_Spec{
Location: tc.AzureRegion,
Owner: testcommon.AsOwner(rg),
Properties: &keyvault.VaultProperties{
AccessPolicies: []keyvault.AccessPolicyEntry{{
ApplicationId: to.StringPtr(str),
ObjectId: to.StringPtr(str),
ApplicationId: to.StringPtr(tc.AzureTenant),
ObjectId: to.StringPtr(tc.AzureTenant),
Permissions: &keyvault.Permissions{
Certificates: []keyvault.PermissionsCertificates{keyvault.PermissionsCertificatesGet},
Keys: []keyvault.PermissionsKeys{keyvault.PermissionsKeysGet},
Secrets: []keyvault.PermissionsSecrets{keyvault.PermissionsSecretsGet},
Storage: []keyvault.PermissionsStorage{keyvault.PermissionsStorageGet},
},
TenantId: to.StringPtr(str),
TenantId: to.StringPtr(tc.AzureTenant),
}},
Sku: &keyvault.Sku{
Family: &skuFamily,
Name: &skuName,
},
TenantId: to.StringPtr(str),
TenantId: to.StringPtr(tc.AzureTenant),
},
},
}

Просмотреть файл

@ -0,0 +1,255 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package controllers_test
import (
"testing"
"github.com/Azure/azure-service-operator/v2/api/compute/v1beta20201201"
"github.com/Azure/azure-service-operator/v2/api/keyvault/v1beta20210401preview"
machinelearningservices "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701"
network "github.com/Azure/azure-service-operator/v2/api/network/v1beta20201101"
resources "github.com/Azure/azure-service-operator/v2/api/resources/v1beta20200601"
storage "github.com/Azure/azure-service-operator/v2/api/storage/v1beta20210401"
"github.com/Azure/azure-service-operator/v2/internal/testcommon"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/go-autorest/autorest/to"
)
func Test_MachineLearning_Workspaces_CRUD(t *testing.T) {
t.Parallel()
tc := globalTestContext.ForTest(t)
rg := tc.CreateTestResourceGroupAndWait()
sa := newStorageAccount(tc, rg)
tc.CreateResourceAndWait(sa)
kv := newVault(tc, rg)
tc.CreateResourceAndWait(kv)
// Have to use 'eastus' location here as 'ListKeys' API is unavailable/still broken for 'westus2'
workspace := newWorkspace(tc, testcommon.AsOwner(rg), sa, kv, to.StringPtr("eastus"))
tc.CreateResourcesAndWait(workspace)
tc.RunSubtests(
testcommon.Subtest{
Name: "WriteWorkspacesSecrets",
Test: func(tc *testcommon.KubePerTestContext) {
Workspaces_WriteSecrets(tc, workspace)
},
})
tc.RunParallelSubtests(
testcommon.Subtest{
Name: "Test_WorkspaceCompute_CRUD",
Test: func(tc *testcommon.KubePerTestContext) {
WorkspaceCompute_CRUD(tc, testcommon.AsOwner(workspace), rg)
},
},
testcommon.Subtest{
Name: "Test_WorkspaceConnection_CRUD",
Test: func(tc *testcommon.KubePerTestContext) {
WorkspaceConnection_CRUD(tc, workspace)
},
},
)
tc.DeleteResourcesAndWait(workspace, kv, sa, rg)
}
func Workspaces_WriteSecrets(tc *testcommon.KubePerTestContext, workspace *machinelearningservices.Workspace) {
old := workspace.DeepCopy()
workspaceKeysSecret := "workspacekeyssecret"
workspace.Spec.OperatorSpec = &machinelearningservices.WorkspaceOperatorSpec{
Secrets: &machinelearningservices.WorkspaceOperatorSecrets{
PrimaryNotebookAccessKey: &genruntime.SecretDestination{Name: workspaceKeysSecret, Key: "primaryNotebookAccessKey"},
SecondaryNotebookAccessKey: &genruntime.SecretDestination{Name: workspaceKeysSecret, Key: "secondaryNotebookAccessKey"},
UserStorageKey: &genruntime.SecretDestination{Name: workspaceKeysSecret, Key: "userStorageKey"},
},
}
tc.PatchResourceAndWait(old, workspace)
tc.ExpectSecretHasKeys(
workspaceKeysSecret,
"primaryNotebookAccessKey",
"secondaryNotebookAccessKey",
"userStorageKey")
}
func newWorkspace(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, sa *storage.StorageAccount, kv *v1beta20210401preview.Vault, location *string) *machinelearningservices.Workspace {
identityType := machinelearningservices.IdentityTypeSystemAssigned
workspaces := &machinelearningservices.Workspace{
ObjectMeta: tc.MakeObjectMetaWithName(tc.NoSpaceNamer.GenerateName("work")),
Spec: machinelearningservices.Workspaces_Spec{
Location: location,
Owner: owner,
Sku: &machinelearningservices.Sku{
Name: to.StringPtr("Standard_S1"),
Tier: to.StringPtr("Basic"),
},
AllowPublicAccessWhenBehindVnet: to.BoolPtr(false),
Identity: &machinelearningservices.Identity{
Type: &identityType,
},
StorageAccountReference: tc.MakeReferenceFromResource(sa),
KeyVaultReference: tc.MakeReferenceFromResource(kv),
},
}
return workspaces
}
func WorkspaceConnection_CRUD(tc *testcommon.KubePerTestContext, workspaces *machinelearningservices.Workspace) {
jsonValue := "{\"foo\":\"bar\", \"baz\":\"bee\"}"
valueFormat := machinelearningservices.WorkspaceConnectionPropsValueFormatJSON
connection := &machinelearningservices.WorkspacesConnection{
ObjectMeta: tc.MakeObjectMeta("conn"),
Spec: machinelearningservices.WorkspacesConnections_Spec{
Owner: testcommon.AsOwner(workspaces),
AuthType: to.StringPtr("PAT"),
Category: to.StringPtr("ACR"),
Location: to.StringPtr("eastus"),
Target: to.StringPtr("www.microsoft.com"),
Value: to.StringPtr(jsonValue),
ValueFormat: &valueFormat,
},
}
tc.CreateResourceAndWait(connection)
tc.DeleteResourceAndWait(connection)
}
func WorkspaceCompute_CRUD(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, rg *resources.ResourceGroup) {
vnet := newVMVirtualNetwork(tc, testcommon.AsOwner(rg))
tc.CreateResourceAndWait(vnet)
subnet := newVMSubnet(tc, testcommon.AsOwner(vnet))
publicIP := newPublicIPAddressForVMSS(tc, testcommon.AsOwner(rg))
nsg := newNetworkSecurityGroup(tc, testcommon.AsOwner(rg))
rule := newNetworkSecurityGroupRule(tc, testcommon.AsOwner(nsg))
tc.CreateResourceAndWait(nsg)
tc.CreateResourceAndWait(rule)
networkInterface := newVMNetworkInterfaceWithPublicIP(tc, testcommon.AsOwner(rg), subnet, publicIP, nsg)
tc.CreateResourcesAndWait(subnet, publicIP, networkInterface)
secret := createVMPasswordSecretAndRef(tc)
vm := newVM(tc, rg, networkInterface, secret)
tc.CreateResourceAndWait(vm)
wsCompute := newWorkspacesCompute(tc, owner, vm, secret)
tc.CreateResourceAndWait(wsCompute)
tc.DeleteResourceAndWait(wsCompute)
tc.DeleteResourceAndWait(vm)
tc.DeleteResourceAndWait(networkInterface)
tc.DeleteResourceAndWait(vnet)
}
func newWorkspacesCompute(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, vm *v1beta20201201.VirtualMachine, secret genruntime.SecretReference) *machinelearningservices.WorkspacesCompute {
identityType := machinelearningservices.IdentityTypeSystemAssigned
computeType := machinelearningservices.ComputeVirtualMachineComputeTypeVirtualMachine
wsCompute := &machinelearningservices.WorkspacesCompute{
ObjectMeta: tc.MakeObjectMetaWithName(tc.NoSpaceNamer.GenerateName("")),
Spec: machinelearningservices.WorkspacesComputes_Spec{
Identity: &machinelearningservices.Identity{
Type: &identityType,
},
Location: tc.AzureRegion,
Owner: owner,
Sku: &machinelearningservices.Sku{
Name: to.StringPtr("Standard_S1"),
Tier: to.StringPtr("Basic"),
},
Properties: &machinelearningservices.Compute{
VirtualMachine: &machinelearningservices.Compute_VirtualMachine{
ComputeLocation: tc.AzureRegion,
ComputeType: &computeType,
DisableLocalAuth: to.BoolPtr(true),
ResourceReference: tc.MakeReferenceFromResource(vm),
Properties: &machinelearningservices.VirtualMachineProperties{
AdministratorAccount: &machinelearningservices.VirtualMachineSshCredentials{
Password: &secret,
Username: to.StringPtr("bloom"),
},
SshPort: to.IntPtr(22),
},
},
},
},
}
return wsCompute
}
func newVMNetworkInterfaceWithPublicIP(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, subnet *network.VirtualNetworksSubnet, publicIP *network.PublicIPAddress, nsg *network.NetworkSecurityGroup) *network.NetworkInterface {
dynamic := network.NetworkInterfaceIPConfigurationPropertiesFormatPrivateIPAllocationMethodDynamic
return &network.NetworkInterface{
ObjectMeta: tc.MakeObjectMeta("nic"),
Spec: network.NetworkInterfaces_Spec{
Owner: owner,
Location: tc.AzureRegion,
IpConfigurations: []network.NetworkInterfaces_Spec_Properties_IpConfigurations{{
Name: to.StringPtr("ipconfig1"),
PrivateIPAllocationMethod: &dynamic,
Subnet: &network.SubResource{
Reference: tc.MakeReferenceFromResource(subnet),
},
PublicIPAddress: &network.SubResource{
Reference: tc.MakeReferenceFromResource(publicIP),
},
}},
NetworkSecurityGroup: &network.SubResource{
Reference: tc.MakeReferenceFromResource(nsg),
},
},
}
}
func newNetworkSecurityGroup(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference) *network.NetworkSecurityGroup {
// Network Security Group
return &network.NetworkSecurityGroup{
ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("nsg")),
Spec: network.NetworkSecurityGroups_Spec{
Location: tc.AzureRegion,
Owner: owner,
},
}
}
func newNetworkSecurityGroupRule(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference) *network.NetworkSecurityGroupsSecurityRule {
protocol := network.SecurityRulePropertiesFormatProtocolTcp
allow := network.SecurityRulePropertiesFormatAccessAllow
direction := network.SecurityRulePropertiesFormatDirectionInbound
// Network Security Group rule
return &network.NetworkSecurityGroupsSecurityRule{
ObjectMeta: tc.MakeObjectMeta("rule1"),
Spec: network.NetworkSecurityGroupsSecurityRules_Spec{
Owner: owner,
Protocol: &protocol,
SourcePortRange: to.StringPtr("*"),
DestinationPortRange: to.StringPtr("22"),
SourceAddressPrefix: to.StringPtr("*"),
DestinationAddressPrefix: to.StringPtr("*"),
Access: &allow,
Priority: to.IntPtr(101),
Direction: &direction,
Description: to.StringPtr("The first rule of networking is don't talk about networking"),
},
}
}

Просмотреть файл

@ -20,6 +20,8 @@ interactions:
headers:
Cache-Control:
- no-cache
Content-Length:
- "276"
Content-Type:
- application/json; charset=utf-8
Expires:
@ -28,12 +30,10 @@ interactions:
- no-cache
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
status: 201 Created
code: 201
duration: ""
- request:
body: ""
@ -66,125 +66,21 @@ interactions:
code: 200
duration: ""
- request:
body: '{"location":"westus2","name":"asotest-keyvau-ngmgjs","properties":{"accessPolicies":[{"applicationId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]},"tenantId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3"}],"sku":{"family":"A","name":"standard"},"tenantId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3"}}'
body: '{"location":"westus2","name":"asotest-keyvault-ngmgjs","properties":{"accessPolicies":[{"applicationId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]},"tenantId":"00000000-0000-0000-0000-000000000000"}],"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000"}}'
form: {}
headers:
Accept:
- application/json
Content-Length:
- "423"
- "425"
Content-Type:
- application/json
Test-Request-Attempt:
- "0"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview
method: PUT
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net","provisioningState":"RegisteringDns"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Server:
- Microsoft-IIS/10.0
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Aspnet-Version:
- 4.0.30319
X-Content-Type-Options:
- nosniff
X-Ms-Keyvault-Service-Version:
- 1.5.372.0
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Test-Request-Attempt:
- "0"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net/","provisioningState":"RegisteringDns"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Server:
- Microsoft-IIS/10.0
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Aspnet-Version:
- 4.0.30319
X-Content-Type-Options:
- nosniff
X-Ms-Keyvault-Service-Version:
- 1.5.372.0
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Test-Request-Attempt:
- "1"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Server:
- Microsoft-IIS/10.0
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Aspnet-Version:
- 4.0.30319
X-Content-Type-Options:
- nosniff
X-Ms-Keyvault-Service-Version:
- 1.5.372.0
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Test-Request-Attempt:
- "2"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}'
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs","name":"asotest-keyvault-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}'
headers:
Cache-Control:
- no-cache
@ -217,7 +113,43 @@ interactions:
- application/json
Test-Request-Attempt:
- "0"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs","name":"asotest-keyvault-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Server:
- Microsoft-IIS/10.0
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Aspnet-Version:
- 4.0.30319
X-Content-Type-Options:
- nosniff
X-Ms-Keyvault-Service-Version:
- 1.5.372.0
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Test-Request-Attempt:
- "0"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview
method: DELETE
response:
body: ""
@ -250,18 +182,18 @@ interactions:
Accept:
- application/json
Test-Request-Attempt:
- "3"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview
- "1"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview
method: GET
response:
body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs''
body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs''
under resource group ''asotest-rg-mftgkw'' was not found. For more details please
go to https://aka.ms/ARMResourceNotFoundFix"}}'
headers:
Cache-Control:
- no-cache
Content-Length:
- "236"
- "238"
Content-Type:
- application/json; charset=utf-8
Expires:
@ -319,126 +251,6 @@ interactions:
- "1"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Test-Request-Attempt:
- "2"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Test-Request-Attempt:
- "3"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Test-Request-Attempt:
- "4"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01
method: GET
response:
body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}'
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json; charset=utf-8
Expires:
- "-1"
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Test-Request-Attempt:
- "5"
url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01
method: GET
response:
body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-mftgkw''
could not be found."}}'

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -11,9 +11,8 @@ import (
"strings"
"time"
"github.com/pkg/errors"
"github.com/Azure/azure-service-operator/v2/internal/metrics"
"github.com/pkg/errors"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"

Просмотреть файл

@ -18,9 +18,14 @@ import (
// this is shared between tests because
// instantiating it requires HTTP calls
var cachedCreds azcore.TokenCredential
var cachedSubID string
var cachedSubID AzureIDs
func getCreds() (azcore.TokenCredential, string, error) {
type AzureIDs struct {
subscriptionID string
tenantID string
}
func getCreds() (azcore.TokenCredential, AzureIDs, error) {
if cachedCreds != nil {
return cachedCreds, cachedSubID, nil
@ -28,15 +33,25 @@ func getCreds() (azcore.TokenCredential, string, error) {
creds, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
return nil, "", errors.Wrapf(err, "creating default credential")
return nil, AzureIDs{}, errors.Wrapf(err, "creating default credential")
}
subscriptionID := os.Getenv(config.SubscriptionIDVar)
if subscriptionID == "" {
return nil, "", errors.Errorf("required environment variable %q was not supplied", config.SubscriptionIDVar)
return nil, AzureIDs{}, errors.Errorf("required environment variable %q was not supplied", config.SubscriptionIDVar)
}
tenantID := os.Getenv(config.TenantIDVar)
if tenantID == "" {
return nil, AzureIDs{}, errors.Errorf("required environment variable %q was not supplied", config.TenantIDVar)
}
ids := AzureIDs{
subscriptionID: subscriptionID,
tenantID: tenantID,
}
cachedCreds = creds
cachedSubID = subscriptionID
return creds, subscriptionID, nil
cachedSubID = ids
return creds, ids, nil
}

Просмотреть файл

@ -49,6 +49,7 @@ type PerTestContext struct {
AzureClientRecorder *recorder.Recorder
AzureClient *genericarmclient.GenericClient
AzureSubscription string
AzureTenant string
AzureMatch *ARMMatcher
Namer ResourceNamer
NoSpaceNamer ResourceNamer
@ -87,7 +88,7 @@ func (tc TestContext) ForTest(t *testing.T) (PerTestContext, error) {
logger := NewTestLogger(t)
cassetteName := "recordings/" + t.Name()
creds, subscriptionID, recorder, err := createRecorder(cassetteName, tc.RecordReplay)
creds, azureIDs, recorder, err := createRecorder(cassetteName, tc.RecordReplay)
if err != nil {
return PerTestContext{}, errors.Wrapf(err, "creating recorder")
}
@ -100,7 +101,7 @@ func (tc TestContext) ForTest(t *testing.T) (PerTestContext, error) {
Transport: addCountHeader(translateErrors(recorder, cassetteName, t)),
}
var armClient *genericarmclient.GenericClient
armClient, err = genericarmclient.NewGenericClientFromHTTPClient(cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint, creds, httpClient, subscriptionID, metrics.NewARMClientMetrics())
armClient, err = genericarmclient.NewGenericClientFromHTTPClient(cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint, creds, httpClient, azureIDs.subscriptionID, metrics.NewARMClientMetrics())
if err != nil {
logger.Error(err, "failed to get new generic client")
t.Fail()
@ -139,7 +140,8 @@ func (tc TestContext) ForTest(t *testing.T) (PerTestContext, error) {
Namer: namer,
NoSpaceNamer: namer.WithSeparator(""),
AzureClient: armClient,
AzureSubscription: subscriptionID,
AzureSubscription: azureIDs.subscriptionID,
AzureTenant: azureIDs.tenantID,
AzureMatch: NewARMMatcher(armClient),
AzureClientRecorder: recorder,
TestName: t.Name(),
@ -183,7 +185,7 @@ func ensureCassetteFileExists(cassetteName string) error {
return nil
}
func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredential, string, *recorder.Recorder, error) {
func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredential, AzureIDs, *recorder.Recorder, error) {
var err error
var r *recorder.Recorder
if recordReplay {
@ -193,23 +195,24 @@ func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredent
}
if err != nil {
return nil, "", nil, errors.Wrapf(err, "creating recorder")
return nil, AzureIDs{}, nil, errors.Wrapf(err, "creating recorder")
}
var creds azcore.TokenCredential
var subscriptionID string
var azureIDs AzureIDs
if r.Mode() == recorder.ModeRecording ||
r.Mode() == recorder.ModeDisabled {
// if we are recording, we need auth
creds, subscriptionID, err = getCreds()
creds, azureIDs, err = getCreds()
if err != nil {
return nil, "", nil, err
return nil, azureIDs, nil, err
}
} else {
// if we are replaying, we won't need auth
// and we use a dummy subscription ID
subscriptionID = uuid.Nil.String()
// and we use a dummy subscription ID/tenant ID
creds = mockTokenCred{}
azureIDs.tenantID = uuid.Nil.String()
azureIDs.subscriptionID = uuid.Nil.String()
}
// check body as well as URL/Method (copied from go-vcr documentation)
@ -240,23 +243,29 @@ func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredent
// rewrite all request/response fields to hide the real subscription ID
// this is *not* a security measure but intended to make the tests updateable from
// any subscription, so a contributor can update the tests against their own sub.
hideSubID := func(s string) string {
return strings.ReplaceAll(s, subscriptionID, uuid.Nil.String())
hideID := func(s string, id string) string {
return strings.ReplaceAll(s, id, uuid.Nil.String())
}
i.Request.Body = hideRecordingData(hideSubID(i.Request.Body))
i.Response.Body = hideRecordingData(hideSubID(i.Response.Body))
i.Request.URL = hideSubID(i.Request.URL)
i.Request.Body = hideRecordingData(hideID(i.Request.Body, azureIDs.subscriptionID))
i.Response.Body = hideRecordingData(hideID(i.Response.Body, azureIDs.subscriptionID))
i.Request.URL = hideID(i.Request.URL, azureIDs.subscriptionID)
i.Request.Body = hideRecordingData(hideID(i.Request.Body, azureIDs.tenantID))
i.Response.Body = hideRecordingData(hideID(i.Response.Body, azureIDs.tenantID))
i.Request.URL = hideID(i.Request.URL, azureIDs.tenantID)
for _, values := range i.Request.Headers {
for i := range values {
values[i] = hideSubID(values[i])
values[i] = hideID(values[i], azureIDs.subscriptionID)
values[i] = hideID(values[i], azureIDs.tenantID)
}
}
for _, values := range i.Response.Headers {
for i := range values {
values[i] = hideSubID(values[i])
values[i] = hideID(values[i], azureIDs.subscriptionID)
values[i] = hideID(values[i], azureIDs.tenantID)
}
}
@ -271,7 +280,7 @@ func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredent
return nil
})
return creds, subscriptionID, r, nil
return creds, azureIDs, r, nil
}
var requestHeadersToRemove = []string{

Просмотреть файл

@ -293,6 +293,7 @@ func createGetKnownStorageTypesFunc(
// }
if indexFuncs, ok := indexFunctions[typeName]; ok {
sliceBuilder := astbuilder.NewSliceLiteralBuilder(astmodel.IndexRegistrationType.AsType(codeGenerationContext), true)
sort.Slice(indexFuncs, orderByFunctionName(indexFuncs))
for _, indexFunc := range indexFuncs {
newIndexFunctionBuilder := astbuilder.NewCompositeLiteralBuilder(astmodel.IndexRegistrationType.AsType(codeGenerationContext))
@ -313,6 +314,8 @@ func createGetKnownStorageTypesFunc(
// }
if secretKeys, ok := secretPropertyKeys[typeName]; ok {
newWatchBuilder := astbuilder.NewCompositeLiteralBuilder(astmodel.WatchRegistrationType.AsType(codeGenerationContext))
sort.Strings(secretKeys)
// Not using astbuilder here because we want this to go onto a single line
source := &dst.CompositeLit{
Type: astmodel.ControllerRuntimeSourceKindType.AsType(codeGenerationContext),