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

moving from private repo to public as part of public preview #31037

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a220dd1
moving from private to public
adityareddy305 Oct 15, 2024
c7cc450
Merge branch 'main' into main
adityareddy305 Oct 16, 2024
c28105a
Merge branch 'main' into main
adityareddy305 Oct 16, 2024
5dca560
Merge branch 'main' into main
adityareddy305 Oct 22, 2024
c618c43
add existing spec and fix type spec
adityareddy305 Oct 24, 2024
36bc448
add existing spec and fix type spec
adityareddy305 Oct 24, 2024
883e70c
Merge branch 'main' of https://github.com/adityareddy305/azure-rest-a…
adityareddy305 Oct 24, 2024
e90550f
Merge branch 'main' into main
adityareddy305 Oct 24, 2024
5983eb1
Fix: Add versioned dependencies and format impact.tsp
adityareddy305 Oct 24, 2024
49f5dc2
Merge branch 'main' of https://github.com/adityareddy305/azure-rest-a…
adityareddy305 Oct 24, 2024
8cf5d30
suppress provisioning status read only
adityareddy305 Oct 24, 2024
86cff07
suppress provisioning status read only
adityareddy305 Oct 24, 2024
63f2e30
suppress aditional properties
adityareddy305 Oct 24, 2024
73d2146
suppress aditional properties
adityareddy305 Oct 24, 2024
03a51ac
add readOnly for provisioning status
adityareddy305 Oct 24, 2024
8a9ae6f
supression for additional properties
adityareddy305 Oct 24, 2024
5889d9f
Merge branch 'main' into main
adityareddy305 Oct 25, 2024
f9d1104
add readonly to provisioning state
adityareddy305 Oct 25, 2024
74ab4ac
Merge branch 'main' of https://github.com/adityareddy305/azure-rest-a…
adityareddy305 Oct 25, 2024
1661aef
add readOnly
adityareddy305 Oct 25, 2024
56706df
add supressions
adityareddy305 Oct 25, 2024
5921747
supression and correct example files
adityareddy305 Oct 25, 2024
53cd6e5
suppress guid message
adityareddy305 Oct 25, 2024
75ecf1e
Merge branch 'main' into main
adityareddy305 Oct 25, 2024
0cb6f98
Merge branch 'main' of https://github.com/adityareddy305/azure-rest-a…
adityareddy305 Oct 25, 2024
b209e39
remove cadl files
adityareddy305 Oct 25, 2024
7b0532b
revert to existing spec
adityareddy305 Oct 25, 2024
297f3f2
fix type spec validation
adityareddy305 Oct 25, 2024
3f4bacb
Merge branch 'main' into main
adityareddy305 Oct 25, 2024
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
81 changes: 81 additions & 0 deletions specification/impact/Impact.Management/ImpactCategories.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Http;
using TypeSpec.Rest;
using OpenAPI;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;

namespace Microsoft.Impact;

@doc("ImpactCategory resource")
@subscriptionResource
model ImpactCategory
is Azure.ResourceManager.ProxyResource<ImpactCategoryProperties> {
@pattern("^[a-zA-Z0-9][a-zA-Z0-9.]*[a-zA-Z0-9]{3,180}$")
@key("impactCategoryName")
@segment("impactCategories")
@doc("Name of the impact category")
@visibility("Read")
@path
name: string;
}

@doc("Impact category properties.")
model ImpactCategoryProperties is ResourceProperties {
@doc("Unique ID of the category")
@pattern("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")
categoryId: string;

@doc("Unique ID of the parent category")
@pattern("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")
parentCategoryId?: string;

@doc("Description of the category")
description?: string;

@doc("The workloadImpact properties which are required when reporting with the impact category")
@extension("x-ms-identifiers", [])
requiredImpactProperties?: RequiredImpactProperties[];
}

@doc("Required impact properties")
model RequiredImpactProperties {
@doc("Name of the property")
name: string;

@doc("Allowed values values for the property")
allowedValues?: string[];
}

#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-uses-templates" "Using subscription scope building blocks"
@armResourceOperations
interface ImpactCategories {
get is ArmResourceRead<ImpactCategory>;

//listBySubscription is ArmListBySubscription<ImpactCategory>;

listBySubscription is ArmResourceListByParent<
ImpactCategory,
BaseParameters<ImpactCategory> & CustomParameters
>;
}

@doc("Custom query params")
model CustomParameters {
@query
@minLength(1)
@doc("Filter by category name ")
@pattern("^[a-zA-Z0-9][a-zA-Z0-9.]*[a-zA-Z0-9]{3,180}$")
categoryName?: string;

@query
@minLength(1)
@doc("Filter by resource type")
resourceType?: string;
}
241 changes: 241 additions & 0 deletions specification/impact/Impact.Management/commonModels.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
import "@typespec/openapi";
import "@typespec/rest";

import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

namespace Microsoft.Impact;

using TypeSpec.Http;
using TypeSpec.Rest;
using OpenAPI;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using Azure.Core;

@doc("Details about impacted performance metrics. Applicable for performance related impact")
model Performance {
@doc("Name of the Metric examples: Disk, IOPs, CPU, GPU, Memory, details can be found from /impactCategories API")
metricName?: string;

@doc("Threshold value for the metric")
expected?: float64;

@doc("Observed value for the metric")
actual?: float64;

@doc("Max and Min Threshold values for the metric")
expectedValueRange?: ExpectedValueRange;

@doc("Unit of the metric ex: Bytes, Percentage, Count, Seconds, Milliseconds, Bytes/Second, Count/Second, etc.., Other")
unit?: MetricUnit;
}

@doc("Details about connectivity issue. Applicable when root resource causing the issue is not identified. For example, when a VM is impacted due to a network issue, the impacted resource could be VM or the network. In such cases, the connectivity field will have the details about both VM and network.")
model Connectivity {
@doc("Protocol used for the connection")
protocol?: Protocol;

@doc("Port number for the connection")
port?: int32;

@doc("Source from which the connection was attempted")
source?: SourceOrTarget;

@doc("target which connection was attempted")
target?: SourceOrTarget;
}

@doc("Max and Min Threshold values for the metric")
model ExpectedValueRange {
@doc("Min threshold value for the metric")
min: float64;

@doc("Max threshold value for the metric")
max: float64;
}

@doc("ARM error code and error message associated with the impact")
model ErrorDetailProperties {
@doc("ARM Error code associated with the impact.")
errorCode?: string;

@doc("ARM Error Message associated with the impact")
errorMessage?: string;
}

@doc("Information about the impacted workload")
model Workload {
@doc("the scenario for the workload")
context?: string;

@doc("Tool used to interact with Azure. SDK, AzPortal, etc.., Other")
toolset?: Toolset;
}

@doc("Client incident details ex: incidentId , incident source")
model ClientIncidentDetails {
@doc("Client incident id. ex : id of the incident created to investigate and address the impact if any.")
clientIncidentId?: string;

@doc("Client incident source. ex : source system name where the incident is created")
clientIncidentSource?: IncidentSource;
}

@doc("List of incident interfaces.")
union IncidentSource {
string,

/** When source of Incident is AzureDevops */
AzureDevops: "AzureDevops",

/** When source of Incident is Microsoft ICM */
ICM: "ICM",

/** When source of Incident is Jira */
Jira: "Jira",

/** When source of Incident is ServiceNow */
ServiceNow: "ServiceNow",

/** When source of Incident is Other */
Other: "Other",
}

@doc("List of impact categories.")
union ImpactCategoryEnum {
string,

/** Availability category */
Availability: "Availability",

/** Performance category */
Performance: "Performance",

/** Other category */
Other: "Other",
}

@doc("List of azure interfaces.")
union Toolset {
string,

/** If communication toolset is Terraform */
Terraform: "Terraform",

/** If communication toolset is Puppet */
Puppet: "Puppet",

/** If communication toolset is Chef */
Chef: "Chef",

/** If communication toolset is SDK */
SDK: "SDK",

/** If communication toolset is Ansible */
Ansible: "Ansible",

/** If communication toolset is ARM */
ARM: "ARM",

/** If communication toolset is Portal */
Portal: "Portal",

/** If communication toolset is Shell */
Shell: "Shell",

/** If communication toolset is Other */
Other: "Other",
}

#suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "This really is a fixed enum"
@doc("Degree of confidence on the impact being a platform issue.")
union ConfidenceLevel {
string,

/** Low confidence on azure being the source of impact */
Low: "Low",

/** Medium confidence on azure being the source of impact */
Medium: "Medium",

/** High confidence on azure being the source of impact */
High: "High",
}

@doc("List of unit of the metric.")
union MetricUnit {
string,

/** When measurement is in ByteSeconds */
ByteSeconds: "ByteSeconds",

/** When measurement is in Bytes */
Bytes: "Bytes",

/** When measurement is in BytesPerSecond */
BytesPerSecond: "BytesPerSecond",

/** When measurement is in Cores */
Cores: "Cores",

/** When measurement is in Count */
Count: "Count",

/** When measurement is in CountPerSecond */
CountPerSecond: "CountPerSecond",

/** When measurement is in MilliCores */
MilliCores: "MilliCores",

/** When measurement is in MilliSeconds */
MilliSeconds: "MilliSeconds",

/** When measurement is in NanoCores */
NanoCores: "NanoCores",

/** When measurement is in Percent */
Percent: "Percent",

/** When measurement is in Seconds */
Seconds: "Seconds",

/** When measurement is in Other than listed */
Other: "Other",
}

@doc("List of protocols")
union Protocol {
string,

/** When communication protocol is TCP */
TCP: "TCP",

/** When communication protocol is UDP */
UDP: "UDP",

/** When communication protocol is HTTP */
HTTP: "HTTP",

/** When communication protocol is HTTPS */
HTTPS: "HTTPS",

/** When communication protocol is RDP */
RDP: "RDP",

/** When communication protocol is FTP */
FTP: "FTP",

/** When communication protocol is SSH */
SSH: "SSH",

/** When communication protocol is Other */
Other: "Other",
}

@doc("Resource details")
model SourceOrTarget {
@doc("Azure resource id, example /subscription/{subscription}/resourceGroup/{rg}/Microsoft.compute/virtualMachine/{vmName}")
@pattern("(\\/[0-9a-zA-Z]+)*")
azureResourceId?: string;
}
58 changes: 58 additions & 0 deletions specification/impact/Impact.Management/connectors.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;

namespace Microsoft.Impact;

@doc("A connector is a resource that can be used to proactively report impacts against workloads in Azure to Microsoft.")
@subscriptionResource
model Connector is ProxyResource<ConnectorProperties> {
@doc("The name of the connector")
@pattern("^[a-zA-Z0-9-]{3,24}$")
@key("connectorName")
@segment("connectors")
@path
name: string;
}

@doc("Details of the Connector.")
model ConnectorProperties is ResourceProperties {
@visibility("read")
@doc("unique id of the connector.")
connectorId: string;

@visibility("read")
@doc("tenant id of this connector")
tenantId: string;

@doc("connector type")
connectorType: Platform;

@visibility("read")
@doc("last run time stamp of this connector in UTC time zone")
lastRunTimeStamp: utcDateTime;
}

@doc("Enum for connector types")
union Platform {
string,

@doc("Type of Azure Monitor")
AzureMonitor: "AzureMonitor",
}

@armResourceOperations(Connector)
interface Connectors {
get is ArmResourceRead<Connector>;
createOrUpdate is ArmResourceCreateOrReplaceAsync<Connector>;
update is ArmResourcePatchSync<Connector, ConnectorProperties>;
delete is ArmResourceDeleteSync<Connector>;
listBySubscription is ArmListBySubscription<Connector>;
}
1 change: 1 addition & 0 deletions specification/impact/Impact.Management/custom-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ImpactedAzureResourceIdParameter
Loading
Loading