Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 38 additions & 108 deletions core/Azure.Mcp.Core/src/Models/Option/OptionDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,26 @@ public static class Common
public const string ResourceGroupName = "resource-group";
public const string AuthMethodName = "auth-method";

public static readonly Option<string> Tenant = new(
$"--{TenantName}"
)
public static readonly Option<string> Tenant = new($"--{TenantName}")
{
Required = false,
Description = "The Microsoft Entra ID tenant ID or name. This can be either the GUID identifier or the display name of your Entra ID tenant."
};

public static readonly Option<string> Subscription = new(
$"--{SubscriptionName}"
)
public static readonly Option<string> Subscription = new($"--{SubscriptionName}")
{
Description = "Specifies the Azure subscription to use. Accepts either a subscription ID (GUID) or display name. " +
"If not specified, the AZURE_SUBSCRIPTION_ID environment variable will be used instead.",
Required = false
};

public static readonly Option<AuthMethod> AuthMethod = new(
$"--{AuthMethodName}"
)
public static readonly Option<AuthMethod> AuthMethod = new($"--{AuthMethodName}")
{
Description = "Authentication method to use. Options: 'credential' (Azure CLI/managed identity), 'key' (access key), or 'connectionString'.",
Required = false
};

public static readonly Option<string> ResourceGroup = new(
$"--{ResourceGroupName}"
)
public static readonly Option<string> ResourceGroup = new($"--{ResourceGroupName}")
{
Description = "The name of the Azure resource group. This is a logical container for Azure resources.",
Required = false
Expand All @@ -56,41 +48,31 @@ public static class RetryPolicy
public const string ModeName = "retry-mode";
public const string NetworkTimeoutName = "retry-network-timeout";

public static readonly Option<double> Delay = new(
$"--{DelayName}"
)
public static readonly Option<double> Delay = new($"--{DelayName}")
{
Description = "Initial delay in seconds between retry attempts. For exponential backoff, this value is used as the base.",
Required = false
};

public static readonly Option<double> MaxDelay = new(
$"--{MaxDelayName}"
)
public static readonly Option<double> MaxDelay = new($"--{MaxDelayName}")
{
Description = "Maximum delay in seconds between retries, regardless of the retry strategy.",
Required = false
};

public static readonly Option<int> MaxRetries = new(
$"--{MaxRetriesName}"
)
public static readonly Option<int> MaxRetries = new($"--{MaxRetriesName}")
{
Description = "Maximum number of retry attempts for failed operations before giving up.",
Required = false
};

public static readonly Option<RetryMode> Mode = new(
$"--{ModeName}"
)
public static readonly Option<RetryMode> Mode = new($"--{ModeName}")
{
Description = "Retry strategy to use. 'fixed' uses consistent delays, 'exponential' increases delay between attempts.",
Required = false
};

public static readonly Option<double> NetworkTimeout = new(
$"--{NetworkTimeoutName}"
)
public static readonly Option<double> NetworkTimeout = new($"--{NetworkTimeoutName}")
{
Description = "Network operation timeout in seconds. Operations taking longer than this will be cancelled.",
Required = false
Expand All @@ -101,9 +83,7 @@ public static class Authorization
{
public const string ScopeName = "scope";

public static readonly Option<string> Scope = new(
$"--{ScopeName}"
)
public static readonly Option<string> Scope = new($"--{ScopeName}")
{
Description = "Scope at which the role assignment or definition applies to, e.g., /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.",
Required = true,
Expand All @@ -122,73 +102,53 @@ public static class LoadTesting
public const string DurationOption = "duration";
public const string RampUpTimeOption = "ramp-up-time";
public const string EndpointOption = "endpoint";
public static readonly Option<string> TestResource = new(
$"--{TestResourceName}"
)
public static readonly Option<string> TestResource = new($"--{TestResourceName}")
{
Description = "The name of the load test resource for which you want to fetch the details.",
Required = false
};
public static readonly Option<string> TestRun = new(
$"--{TestRunId}"
)
public static readonly Option<string> TestRun = new($"--{TestRunId}")
{
Description = "The ID of the load test run for which you want to fetch the details.",
Required = false
};
public static readonly Option<string> Test = new(
$"--{TestId}"
)
public static readonly Option<string> Test = new($"--{TestId}")
{
Description = "The ID of the load test for which you want to fetch the details.",
Description = "The ID of the load test for which you want to fetch the details (between 2 and 50 characters).",
Required = true
};
public static readonly Option<string> DisplayName = new(
$"--{DisplayNameOption}"
)
public static readonly Option<string> DisplayName = new($"--{DisplayNameOption}")
{
Description = "The display name for the load test run. This is a user-friendly name to identify the test run.",
Description = "The display name for the load test run. This is a user-friendly name to identify the test run (between 2 and 50 characters).",
Required = false
};
public static readonly Option<string> Description = new(
$"--{DescriptionOption}"
)
public static readonly Option<string> Description = new($"--{DescriptionOption}")
{
Description = "The description for the load test run. This provides additional context about the test run.",
Description = "The description for the load test run. This provides additional context about the test run (maximum of 100 characters).",
Required = false
};
public static readonly Option<string> OldTestRunId = new(
$"--{OldTestRunIdOption}"
)
public static readonly Option<string> OldTestRunId = new($"--{OldTestRunIdOption}")
{
Description = "The ID of an existing test run to update. If provided, the command will trigger a rerun of the given test run id.",
Required = false
};

public static readonly Option<int> VirtualUsers = new(
$"--{VirtualUsersOption}"
)
public static readonly Option<int> VirtualUsers = new($"--{VirtualUsersOption}")
{
Description = "Virtual users is a measure of load that is simulated to test the HTTP endpoint. (Default - 50)",
Required = false
};
public static readonly Option<int> Duration = new(
$"--{DurationOption}"
)
public static readonly Option<int> Duration = new($"--{DurationOption}")
{
Description = "This is the duration for which the load is simulated against the endpoint. Enter decimals for fractional minutes (e.g., 1.5 for 1 minute and 30 seconds). Default is 20 mins",
Required = false
};
public static readonly Option<int> RampUpTime = new(
$"--{RampUpTimeOption}"
)
public static readonly Option<int> RampUpTime = new($"--{RampUpTimeOption}")
{
Description = "The ramp-up time is the time it takes for the system to ramp-up to the total load specified. Enter decimals for fractional minutes (e.g., 1.5 for 1 minute and 30 seconds). Default is 1 min",
Required = false
};
public static readonly Option<string> Endpoint = new(
$"--{EndpointOption}"
)
public static readonly Option<string> Endpoint = new($"--{EndpointOption}")
{
Description = "The endpoint URL to be tested. This is the URL of the HTTP endpoint that will be subjected to load testing.",
Required = false
Expand All @@ -213,121 +173,91 @@ public static class Marketplace
public const string ExpandName = "expand";
public const string NextCursorName = "next-cursor";

public static readonly Option<string> ProductId = new(
$"--{ProductIdName}"
)
public static readonly Option<string> ProductId = new($"--{ProductIdName}")
{
Description = "The ID of the marketplace product to retrieve. This is the unique identifier for the product in the Azure Marketplace.",
Required = true
};

public static readonly Option<bool> IncludeStopSoldPlans = new(
$"--{IncludeStopSoldPlansName}"
)
public static readonly Option<bool> IncludeStopSoldPlans = new($"--{IncludeStopSoldPlansName}")
{
Description = "Include stop-sold or hidden plans in the response.",
Required = false
};

public static readonly Option<string> Language = new(
$"--{LanguageName}"
)
public static readonly Option<string> Language = new($"--{LanguageName}")
{
Description = "Product language code (e.g., 'en' for English, 'fr' for French).",
Required = false
};

public static readonly Option<string> Market = new(
$"--{MarketName}"
)
public static readonly Option<string> Market = new($"--{MarketName}")
{
Description = "Product market code (e.g., 'US' for United States, 'UK' for United Kingdom).",
Required = false
};

public static readonly Option<bool> LookupOfferInTenantLevel = new(
$"--{LookupOfferInTenantLevelName}"
)
public static readonly Option<bool> LookupOfferInTenantLevel = new($"--{LookupOfferInTenantLevelName}")
{
Description = "Check against tenant private audience when retrieving the product.",
Required = false
};

public static readonly Option<string> PlanId = new(
$"--{PlanIdName}"
)
public static readonly Option<string> PlanId = new($"--{PlanIdName}")
{
Description = "Filter results by a specific plan ID.",
Required = false
};

public static readonly Option<string> SkuId = new(
$"--{SkuIdName}"
)
public static readonly Option<string> SkuId = new($"--{SkuIdName}")
{
Description = "Filter results by a specific SKU ID.",
Required = false
};

public static readonly Option<bool> IncludeServiceInstructionTemplates = new(
$"--{IncludeServiceInstructionTemplatesName}"
)
public static readonly Option<bool> IncludeServiceInstructionTemplates = new($"--{IncludeServiceInstructionTemplatesName}")
{
Description = "Include service instruction templates in the response.",
Required = false
};

public static readonly Option<string> PricingAudience = new(
$"--{PricingAudienceName}"
)
public static readonly Option<string> PricingAudience = new($"--{PricingAudienceName}")
{
Description = "Pricing audience for the request header.",
Required = false
};

public static readonly Option<string> Search = new(
$"--{SearchName}"
)
public static readonly Option<string> Search = new($"--{SearchName}")
{
Description = "Search for products using a short general term (up to 25 characters)",
Required = false
};

public static readonly Option<string> Filter = new(
$"--{FilterName}"
)
public static readonly Option<string> Filter = new($"--{FilterName}")
{
Description = "OData filter expression to filter results based on ProductSummary properties (e.g., \"displayName eq 'Azure'\").",
Required = false
};

public static readonly Option<string> OrderBy = new(
$"--{OrderByName}"
)
public static readonly Option<string> OrderBy = new($"--{OrderByName}")
{
Description = "OData orderby expression to sort results by ProductSummary fields (e.g., \"displayName asc\" or \"popularity desc\").",
Required = false
};

public static readonly Option<string> Select = new(
$"--{SelectName}"
)
public static readonly Option<string> Select = new($"--{SelectName}")
{
Description = "OData select expression to choose specific ProductSummary fields to return (e.g., \"displayName,publisherDisplayName,uniqueProductId\").",
Required = false
};

public static readonly Option<string> NextCursor = new(
$"--{NextCursorName}"
)
public static readonly Option<string> NextCursor = new($"--{NextCursorName}")
{
Description = "Pagination cursor to retrieve the next page of results. Use the NextPageLink value from a previous response.",
Required = false
};

public static readonly Option<string> Expand = new(
$"--{ExpandName}"
)
public static readonly Option<string> Expand = new($"--{ExpandName}")
{
Description = "OData expand expression to include related data in the response (e.g., \"plans\" to include plan details).",
Required = false
Expand Down
Loading