Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6 SDK: Missing 'archiveDescription' object within Event Hubs #446

Closed
tombuildsstuff opened this issue Nov 5, 2016 · 3 comments
Closed

Comments

@tombuildsstuff
Copy link
Contributor

Hello!

Thanks for all the recent support :)

I'm working my way through adding EventHub support to Terraform - and comparing the result against some corresponding ARM Templates to validate that I've ported a real-world use-case.

In particular I'm trying to work out how to replicate the Archiving functionality provided by the following EventHub ARM:

{
  "apiVersion": "",
  "name": "",
  "type": "eventhubs",
  "location": "",
  "properties": {
    "eventHubPath": "",
    "MessageRetentionInDays": "",
    "partitionCount": "",
    "archiveDescription": {
      "enabled": "",
      "encoding": "",
      "intervalInSeconds": "",
      "sizeLimitInBytes": "",
      "destination": {
        "name": "EventHubArchive.AzureBlockBlob",
        "properties": {
          "StorageAccountResourceId": "",
          "BlobContainer": ""
        }
      }
    }
  }
}

For context, this functionality is also available in the Portal too - but in both of these it's part of the EventHub object.

Unfortunately I can't find a corresponding object within the SDK at present:

// ConsumerGroupProperties is
type ConsumerGroupProperties struct {
	CreatedAt    *date.Time `json:"createdAt,omitempty"`
	EventHubPath *string    `json:"eventHubPath,omitempty"`
	UpdatedAt    *date.Time `json:"updatedAt,omitempty"`
	UserMetadata *string    `json:"userMetadata,omitempty"`
}

// ConsumerGroupResource is description of Consumer Group Resource.
type ConsumerGroupResource struct {
	autorest.Response `json:"-"`
	ID                *string                  `json:"id,omitempty"`
	Name              *string                  `json:"name,omitempty"`
	Type              *string                  `json:"type,omitempty"`
	Location          *string                  `json:"location,omitempty"`
	Tags              *map[string]*string      `json:"tags,omitempty"`
	Properties        *ConsumerGroupProperties `json:"properties,omitempty"`
}

// CreateOrUpdateParameters is parameters supplied to the CreateOrUpdate
// EventHub operation.
type CreateOrUpdateParameters struct {
	Location   *string     `json:"location,omitempty"`
	Type       *string     `json:"type,omitempty"`
	Name       *string     `json:"name,omitempty"`
	Properties *Properties `json:"properties,omitempty"`
}

// NamespaceCreateOrUpdateParameters is parameters supplied to the
// CreateOrUpdate Namespace operation.
type NamespaceCreateOrUpdateParameters struct {
	Location   *string              `json:"location,omitempty"`
	Sku        *Sku                 `json:"sku,omitempty"`
	Tags       *map[string]*string  `json:"tags,omitempty"`
	Properties *NamespaceProperties `json:"properties,omitempty"`
}

// NamespaceProperties is properties of the Namespace.
type NamespaceProperties struct {
	ProvisioningState  *string        `json:"provisioningState,omitempty"`
	Status             NamespaceState `json:"status,omitempty"`
	CreatedAt          *date.Time     `json:"createdAt,omitempty"`
	UpdatedAt          *date.Time     `json:"updatedAt,omitempty"`
	ServiceBusEndpoint *string        `json:"serviceBusEndpoint,omitempty"`
	CreateACSNamespace *bool          `json:"createACSNamespace,omitempty"`
	Enabled            *bool          `json:"enabled,omitempty"`
}

// NamespaceResource is description of a Namespace resource.
type NamespaceResource struct {
	autorest.Response `json:"-"`
	ID                *string              `json:"id,omitempty"`
	Name              *string              `json:"name,omitempty"`
	Type              *string              `json:"type,omitempty"`
	Location          *string              `json:"location,omitempty"`
	Tags              *map[string]*string  `json:"tags,omitempty"`
	Sku               *Sku                 `json:"sku,omitempty"`
	Properties        *NamespaceProperties `json:"properties,omitempty"`
}

// Properties is
type Properties struct {
	CreatedAt              *date.Time   `json:"createdAt,omitempty"`
	MessageRetentionInDays *int64       `json:"messageRetentionInDays,omitempty"`
	PartitionCount         *int64       `json:"partitionCount,omitempty"`
	PartitionIds           *[]string    `json:"partitionIds,omitempty"`
	Status                 EntityStatus `json:"status,omitempty"`
	UpdatedAt              *date.Time   `json:"updatedAt,omitempty"`
}

// ResourceType is description of EventHub Resource.
type ResourceType struct {
	autorest.Response `json:"-"`
	ID                *string             `json:"id,omitempty"`
	Name              *string             `json:"name,omitempty"`
	Type              *string             `json:"type,omitempty"`
	Location          *string             `json:"location,omitempty"`
	Tags              *map[string]*string `json:"tags,omitempty"`
	Properties        *Properties         `json:"properties,omitempty"`
}

By using the Web Inspector in the Portal - I can see the field exists - it's just not being mapped back in the SDK: (I've anonymised this a little)

{
	"name": "test",
	"type": "Microsoft.EventHub/EventHubs",
	"location": "West US",
	"properties": {
		"messageRetentionInDays": 1,
		"status": "Active",
		"partitionCount": 2,
		"archiveDescription": {
			"enabled": true,
			"encoding": "Avro",
			"intervalInSeconds": 300,
			"sizeLimitInBytes": 314572800,
			"destination": {
				"name": "EventHubArchive.AzureBlockBlob",
				"properties": {
					"StorageAccountResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestEurope/providers/Microsoft.ClassicStorage/storageAccounts/portalvhds2fkzqcvkg235h",
					"BlobContainer": "vhds"
				}
			}
		}
	}
}

Assuming that this field isn't being deprecated - is it possible to add the archiveDescription object to the SDK Result for the associated EventHub calls please? I can open a bug on the Rest API Specs if it needs the Swagger fixing there?

Thanks! :)

@mcardosos
Copy link
Contributor

Hey @tombuildsstuff , thanks for reporting this.
Already opened the specs issue.

@tombuildsstuff
Copy link
Contributor Author

Thanks @mcardosos :)

@marstr
Copy link
Member

marstr commented Feb 16, 2017

Howdy folks, it seems like this is taken care of, given that linked work-items in the specs repo above. Any changes to the swagger will automatically get pulled into our release, so there are no more action-items for this issue on our team.

I'll close this issue out, feel free to re-open if there is some subtlety that I'm missing.

@marstr marstr closed this as completed Feb 16, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants