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

[Sample Issue] #4178

Open
2 of 9 tasks
bidhan690 opened this issue Feb 15, 2024 · 1 comment
Open
2 of 9 tasks

[Sample Issue] #4178

bidhan690 opened this issue Feb 15, 2024 · 1 comment
Assignees
Labels
customer-reported question Further information is requested

Comments

@bidhan690
Copy link

Link to sample

https://learn.microsoft.com/en-us/rest/api/container-instances/container-groups/list?view=rest-container-instances-2023-05-01&tabs=JavaScript

Library name and version

@azure/arm-containerinstance

Language of the Sample

  • C#/.NET
  • Java
  • JavaScript/TypedScript
  • Python
  • Golang
  • Other - Please specify in Issue details field

Sample Issue Type

  • Sample not working
  • Sample missing
  • Do not understand sample

Issue details

not getting actual enough response that i need

"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"instanceView": {
"restartCount": 0,
"currentState": {
"state": "Running",
"startTime": "2017-10-17T17:27:21Z",
"detailStatus": ""
},
// other res
]``

Expected behavior

{
"value": [
{
"id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"location": "WestUs",
"zones": [
"1"
],
"name": "demo1",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"instanceView": {
"restartCount": 0,
"currentState": {
"state": "Running",
"startTime": "2017-10-17T17:27:21Z",
"detailStatus": ""
},
"events": []
},
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5
}
},
"volumeMounts": [
{
"mountPath": "/mnt/volume1",
"name": "volume1",
"readOnly": false
}
]
}
}
],
"imageRegistryCredentials": [
{
"server": "azcloudconsoleregistry.azurecr.io",
"username": "azcloudconsoleregistry"
}
],
"ipAddress": {
"ip": "10.0.0.1",
"ports": [
{
"port": 80,
"protocol": "TCP"
}
],
"type": "Public"
},
"osType": "Linux",
"provisioningState": "Succeeded",
"volumes": [
{
"azureFile": {
"readOnly": false,
"shareName": "share1",
"storageAccountName": "storage1"
},
"name": "volume1"
}
]
},
"type": "Microsoft.ContainerInstance/containerGroups"
}
]
}``

Actual behavior

{"id":"/subscriptions/__/resourceGroups/__/providers/Microsoft.ContainerInstance/containerGroups/aci-fat-substantial-butcher","name":"aci-fat-substantial-butcher","type":"Microsoft.ContainerInstance/containerGroups","location":"__","provisioningState":"Succeeded","containers":[{"name":"fat-substantial-butcher","image":"__","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.5,"cpu":1}}}],"imageRegistryCredentials":[],"restartPolicy":"Never","osType":"Linux","sku":"Standard","initContainers":[]}

Reproduction Steps

const aciInstances = new Array();
for await (let item of aciClient.containerGroups.list()) {
aciInstances.push(item);
}
console.log(aciInstances);

Environment

Node.js 20 lts

@microsoft-github-policy-service microsoft-github-policy-service bot added question Further information is requested customer-reported labels Feb 15, 2024
@kazrael2119 kazrael2119 self-assigned this Jul 3, 2024
@kazrael2119
Copy link

Hi @bidhan690 , this is because console.log will simplify the display of deeply nested objects or arrays to improve readability. So if you want to get full log, you can try to use console.dir() to print the result.
Here is the sample:

const resArray = new Array();
    for await (let item of client.containerGroups.list()) {
      resArray.push(item);
    }
    console.dir(resArray, { depth: null, colors: true })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants