Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.31 KB

File metadata and controls

48 lines (37 loc) · 1.31 KB

Sample for storage operations with MK/IO SDK

using MK.IO;
using MK.IO.Models;

// **********************
// MK/IO Client creation
// **********************

var client = new MKIOClient("mkiosubscriptionname", "mkiotoken");

// *******************
// storage operations
// *******************

// Creation
var storage = client.StorageAccounts.Create(new StorageRequestSchema
            {
                Spec = new StorageSchema
                {
                    Name = "amsxpfrstorage",
                    Location = "francecentral",
                    Description = "my description",
                    AzureStorageConfiguration = new BlobStorageAzureProperties
                    {
                        Url = "https://insertyoursasuri"
                    }
                }
            }
            );

// List
var storages = client.StorageAccounts.List();

// Get
var storage2 = client.StorageAccounts.Get((Guid)storages.First().Metadata.Id);

// Delete
client.StorageAccounts.Delete((Guid)storages.First().Metadata.Id);

// List credentials of a storage
var credentials = client.StorageAccounts.ListCredentials((Guid)storages.First().Metadata.Id);

// Get specific credential
var credential = client.StorageAccounts.GetCredential((Guid)storages.First().Metadata.Id, (Guid)credentials.First().Metadata.Id);