Exemple #1
0
        public static string[][] GetEntityCounts(MediaClient mediaClient)
        {
            int assets             = mediaClient.GetEntityCount <Asset>(MediaEntity.Asset);
            int transforms         = mediaClient.GetEntityCount <Transform>(MediaEntity.Transform);
            int transformJobs      = mediaClient.GetEntityCount <Job, Transform>(MediaEntity.TransformJob, MediaEntity.Transform);
            int contentKeyPolicies = mediaClient.GetEntityCount <ContentKeyPolicy>(MediaEntity.ContentKeyPolicy);
            int streamingPolicies  = mediaClient.GetEntityCount <StreamingPolicy>(MediaEntity.StreamingPolicy);
            int streamingEndpoints = mediaClient.GetEntityCount <StreamingEndpoint>(MediaEntity.StreamingEndpoint);
            int streamingLocators  = mediaClient.GetEntityCount <StreamingLocator>(MediaEntity.StreamingLocator);
            int filtersAccount     = mediaClient.GetEntityCount <AccountFilter>(MediaEntity.FilterAccount);
            int filtersAsset       = mediaClient.GetEntityCount <AssetFilter, Asset>(MediaEntity.FilterAsset, MediaEntity.Asset);
            int liveEvents         = mediaClient.GetEntityCount <LiveEvent>(MediaEntity.LiveEvent);
            int liveEventOutputs   = mediaClient.GetEntityCount <LiveOutput, LiveEvent>(MediaEntity.LiveEventOutput, MediaEntity.LiveEvent);
            int indexerInsights    = !mediaClient.IndexerEnabled() ? 0 : mediaClient.IndexerGetInsights().Count;

            List <string[]> entityCounts = new List <string[]>();

            entityCounts.Add(new string[] { "Storage Accounts", mediaClient.StorageAccounts.Count.ToString(Constant.TextFormatter.NumericLong), "/account/storageAccounts" });
            entityCounts.Add(new string[] { "Media Assets", assets.ToString(Constant.TextFormatter.NumericLong), "/asset" });
            entityCounts.Add(new string[] { "Media Transforms", transforms.ToString(Constant.TextFormatter.NumericLong), "/transform" });
            entityCounts.Add(new string[] { "Media Transform Jobs", transformJobs.ToString(Constant.TextFormatter.NumericLong), "/job" });
            entityCounts.Add(new string[] { "Content Key Policies", contentKeyPolicies.ToString(Constant.TextFormatter.NumericLong), "/account/contentKeyPolicies" });
            entityCounts.Add(new string[] { "Streaming Policies", streamingPolicies.ToString(Constant.TextFormatter.NumericLong), "/account/streamingPolicies" });
            entityCounts.Add(new string[] { "Streaming Endpoints", streamingEndpoints.ToString(Constant.TextFormatter.NumericLong), "/account/streamingEndpoints" });
            entityCounts.Add(new string[] { "Streaming Locators", streamingLocators.ToString(Constant.TextFormatter.NumericLong), "/account/streamingLocators" });
            entityCounts.Add(new string[] { "Filters (Account)", filtersAccount.ToString(Constant.TextFormatter.NumericLong), "/account/filtersAccount" });
            entityCounts.Add(new string[] { "Filters (Asset)", filtersAsset.ToString(Constant.TextFormatter.NumericLong), "/account/filtersAsset" });
            entityCounts.Add(new string[] { "Live Events", liveEvents.ToString(Constant.TextFormatter.NumericLong), "/account/liveEvents" });
            entityCounts.Add(new string[] { "Live Event Outputs", liveEventOutputs.ToString(Constant.TextFormatter.NumericLong), "/account/liveEventOutputs" });
            entityCounts.Add(new string[] { "Video Indexer Insights", indexerInsights.ToString(Constant.TextFormatter.NumericLong), "/insight" });

            return(entityCounts.ToArray());
        }
Exemple #2
0
        public static string[][] GetEntityCounts(MediaClient mediaClient)
        {
            int assets                  = mediaClient.GetEntityCount <Asset>(MediaEntity.Asset);
            int transforms              = mediaClient.GetEntityCount <Transform>(MediaEntity.Transform);
            int transformJobs           = mediaClient.GetEntityCount <Job, Transform>(MediaEntity.TransformJob, MediaEntity.Transform);
            int contentKeyPolicies      = mediaClient.GetEntityCount <ContentKeyPolicy>(MediaEntity.ContentKeyPolicy);
            int streamingPolicies       = mediaClient.GetEntityCount <StreamingPolicy>(MediaEntity.StreamingPolicy);
            int streamingEndpoints      = mediaClient.GetEntityCount <StreamingEndpoint>(MediaEntity.StreamingEndpoint);
            int streamingLocators       = mediaClient.GetEntityCount <StreamingLocator>(MediaEntity.StreamingLocator);
            int streamingFiltersAccount = mediaClient.GetEntityCount <AccountFilter>(MediaEntity.StreamingFilterAccount);
            int streamingFiltersAsset   = mediaClient.GetEntityCount <AssetFilter, Asset>(MediaEntity.StreamingFilterAsset, MediaEntity.Asset);
            int liveEvents              = mediaClient.GetEntityCount <LiveEvent>(MediaEntity.LiveEvent);
            int liveEventOutputs        = mediaClient.GetEntityCount <LiveOutput, LiveEvent>(MediaEntity.LiveEventOutput, MediaEntity.LiveEvent);

            bool indexerEnabled        = mediaClient.IndexerEnabled();
            int  indexerInsights       = !indexerEnabled ? 0 : mediaClient.IndexerGetInsights().Count;
            int  indexerProjects       = !indexerEnabled ? 0 : mediaClient.IndexerGetProjects().Count;
            int  indexerModelsPeople   = !indexerEnabled ? 0 : mediaClient.IndexerGetModels(MediaInsightModel.People).Count;
            int  indexerModelsLanguage = !indexerEnabled ? 0 : mediaClient.IndexerGetModels(MediaInsightModel.Language).Count;
            int  indexerModelsBrand    = !indexerEnabled ? 0 : mediaClient.IndexerGetModels(MediaInsightModel.Brand).Count;

            List <string[]> entityCounts = new List <string[]>
            {
                new string[] { "Storage Accounts", mediaClient.StorageAccounts.Count.ToString(Constant.TextFormatter.NumericLong), "/account/storageAccounts" },
                new string[] { "Media Assets", assets.ToString(Constant.TextFormatter.NumericLong), "/asset" },
                new string[] { "Media Transforms", transforms.ToString(Constant.TextFormatter.NumericLong), "/transform" },
                new string[] { "Media Transform Jobs", transformJobs.ToString(Constant.TextFormatter.NumericLong), "/job" },
                new string[] { "Content Key Policies", contentKeyPolicies.ToString(Constant.TextFormatter.NumericLong), "/account/contentKeyPolicies" },
                new string[] { "Streaming Policies", streamingPolicies.ToString(Constant.TextFormatter.NumericLong), "/account/streamingPolicies" },
                new string[] { "Streaming Endpoints", streamingEndpoints.ToString(Constant.TextFormatter.NumericLong), "/account/streamingEndpoints" },
                new string[] { "Streaming Locators", streamingLocators.ToString(Constant.TextFormatter.NumericLong), "/account/streamingLocators" },
                new string[] { "Streaming Filters (Account)", streamingFiltersAccount.ToString(Constant.TextFormatter.NumericLong), "/account/streamingFiltersAccount" },
                new string[] { "Streaming Filters (Asset)", streamingFiltersAsset.ToString(Constant.TextFormatter.NumericLong), "/account/streamingFiltersAsset" },
                new string[] { "Live Events", liveEvents.ToString(Constant.TextFormatter.NumericLong), "/account/liveEvents" },
                new string[] { "Live Event Outputs", liveEventOutputs.ToString(Constant.TextFormatter.NumericLong), "/account/liveEventOutputs" },
                new string[] { "Video Indexer Insights", indexerInsights.ToString(Constant.TextFormatter.NumericLong), "/insight" },
                new string[] { "Video Indexer Projects", indexerProjects.ToString(Constant.TextFormatter.NumericLong), "/insight/projects" },
                new string[] { "Video Indexer Models (People)", indexerModelsPeople.ToString(Constant.TextFormatter.NumericLong), "/insight/modelsPeople" },
                new string[] { "Video Indexer Models (Language)", indexerModelsLanguage.ToString(Constant.TextFormatter.NumericLong), "/insight/modelsLanguage" },
                new string[] { "Video Indexer Models (Brand)", indexerModelsBrand.ToString(Constant.TextFormatter.NumericLong), "/insight/modelsBrand" }
            };

            return(entityCounts.ToArray());
        }