{"type":"api","title":"Create Resource","meta":{"id":"/apps/pubhub/media/nexus-dashboard-api-411/1d680a4cdd0fc79ff5ea7816bfd85c04c5374398/6892077b-82e7-33df-b47a-dd1fcda33552","info":{"contact":{"name":"API Support","url":"https://developer.cisco.com/docs/nexus-dashboard/4-1/developer-support/"},"description":"Manage APIs provide the ability to manage resources connected to the cluster","title":"Nexus Dashboard Manage v1","version":"1.0.130","x-nd-server-ignore":true},"x-parser-conf":{"overview":{"markdownPath":"reference-overviews/overview-manage.md"},"labelConfig":{"endpoint":{"field":"operationId","format":"startCase"}}},"openapi":"3.0.3","servers":[{"description":"Nexus Dashboard Manage APIs","url":"https://{cluster}/api/v1/manage","variables":{"cluster":{"default":"example.com","description":"The cluster URL/IP address","enum":["example.com","10.1.1.20"]}}}],"securitySchemes":{"OAuth2":{"type":"oauth2","description":"OAuth2 security scheme","flows":{"implicit":{"authorizationUrl":"https://example.com/login","scopes":{"observer":"Grants read access","fabric-admin":"Grants write access to fabric resources","support-engineer":"Primarily a role for support engineers to operate the managed resources","super-admin":"Grants access to all operations","approver":"Grants access to approve policies","designer":"Grants access to design policies"}}}},"http_signature":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"HTTP Signature security scheme"},"cookieAuth":{"type":"apiKey","description":"Cookie based authentication","in":"cookie","name":"AuthCookie"}}},"spec":{"operationId":"createResource","parameters":[{"description":"Name of the fabric","example":"fabric1","in":"path","name":"fabricName","required":true,"schema":{"type":"string","maxLength":64,"minLength":1},"$$ref":"#/components/parameters/pathFabricName"}],"requestBody":{"content":{"application/json":{"example":{"resources":[{"entityName":"loopback2","isPreAllocated":true,"poolName":"LOOPBACK_ID","resourceValue":"23","scopeDetails":{"fabricName":"fabric1","scopeType":"device","switchId":"FDO222419B7","switchIp":"172.10.10.1","switchName":"leaf1"},"vrfName":"vrf1"},{"entityName":"MyNetwork_30000","isPreAllocated":false,"poolName":"L2_VNI","resourceValue":"23001","scopeDetails":{"fabricName":"fabric1","scopeType":"fabric"},"vrfName":"vrf1"}]},"schema":{"description":"Resource details needed for allocation given in array form","properties":{"resources":{"description":"Array of resources that are needed for resource allocation","items":{"description":"Needed resource details for resource allocation","properties":{"entityName":{"description":"Indicates the Name by which the resource is allocated","type":"string"},"isPreAllocated":{"default":false,"description":"Set it to true if the resource is pre-allocated to an entity i.e resource is reserved","type":"boolean"},"poolName":{"description":"Pool under which the resource is allocated","type":"string"},"resourceValue":{"description":"Resource can be an ID, IP or Subnet resource being managed in RM","type":"string"},"scopeDetails":{"description":"Based on Scope type the scope details are taken","discriminator":{"mapping":{"device":"#/components/schemas/deviceScope","deviceInterface":"#/components/schemas/deviceInterfaceScope","devicePair":"#/components/schemas/devicePairScope","fabric":"#/components/schemas/fabricScope","link":"#/components/schemas/linkScope"},"propertyName":"scopeType"},"oneOf":[{"description":"Scope details for resource that are under fabric Scope","properties":{"fabricName":{"description":"indicates the fabric name","type":"string"},"scopeType":{"description":"Indicates the scope level for the resource under which the uniqueness is maintained.","enum":["fabric"],"type":"string"}},"required":["fabricName","scopeType"],"type":"object","$$ref":"#/components/schemas/fabricScope"},{"description":"Scope details for resource that are under Device Scope","properties":{"scopeType":{"description":"Indicates the scope level for the resource under which the uniqueness is maintained.","enum":["device"],"type":"string"},"switchId":{"description":"Indicates the serial Number of the switch","type":"string"},"switchIp":{"description":"IP Address of the switch","type":"string"},"switchName":{"description":"Indicates the name of the switch","type":"string"}},"required":["switchId","scopeType"],"type":"object","$$ref":"#/components/schemas/deviceScope"},{"description":"Scope details for resource that are under deviceInterface Scope","properties":{"interfaceName":{"description":"interface name","type":"string"},"scopeType":{"description":"Indicates the scope level for the resource under which the uniqueness is maintained.","enum":["deviceInterface"],"type":"string"},"switchId":{"description":"Indicates the serial Number of the switch","type":"string"},"switchIp":{"description":"IP Address of the switch","type":"string"},"switchName":{"description":"Indicates the name of the switch","type":"string"}},"required":["switchid","interfaceName","scopeType"],"type":"object","$$ref":"#/components/schemas/deviceInterfaceScope"},{"description":"Scope details for resource that are under Link Scope","properties":{"dstInterfaceName":{"description":"Destination switch's interface name","type":"string"},"dstSwitchId":{"description":"Indicates the serial Number of the Destination switch","type":"string"},"dstSwitchIp":{"description":"IP Address of the Destination switch","type":"string"},"dstSwitchName":{"description":"Indicates the name of the Destination switch on the link","type":"string"},"scopeType":{"description":"Indicates the scope level for the resource under which the uniqueness is maintained.","enum":["link"],"type":"string"},"srcInterfaceName":{"description":"source switch's interface name","type":"string"},"srcSwitchId":{"description":"Indicates the serial Number of the source switch","type":"string"},"srcSwitchIp":{"description":"IP Address of the source switch","type":"string"},"srcSwitchName":{"description":"Indicates the name of the Source switch in the link","type":"string"}},"required":["srcSwitchId","srcInterfaceName","dstSwitchId","dstInterfaceName","scopeType"],"type":"object","$$ref":"#/components/schemas/linkScope"},{"description":"Scope details for resource that are under devicePair Scope","properties":{"dstSwitchId":{"description":"Indicates the serial Number of the Destination switch","type":"string"},"dstSwitchIp":{"description":"IP Address of the Destination switch","type":"string"},"dstSwitchName":{"description":"Indicates the name of the Destination switch on the link","type":"string"},"scopeType":{"description":"Indicates the scope level for the resource under which the uniqueness is maintained.","enum":["devicePair"],"type":"string"},"srcSwitchId":{"description":"Indicates the serial Number of the source switch","type":"string"},"srcSwitchIp":{"description":"IP Address of the source switch","type":"string"},"srcSwitchName":{"description":"Indicates the name of the Source switch in the link","type":"string"}},"required":["srcSwitchId","dstSwitchId","scopeType"],"type":"object","$$ref":"#/components/schemas/devicePairScope"}]},"vrfName":{"default":"default","description":"shows the VRf name if the pool is a VRF level pool and the resource allocation is done on VRF level","type":"string"}},"type":"object","$$ref":"#/components/schemas/resourceDetailsPost","required":["poolName","scopeDetails"]},"type":"array"}},"type":"object"}}},"description":"Schema for Allocate resource","required":true},"responses":{"207":{"content":{"application/json":{"example":{"resources":[{"message":"Created successfully","resourceId":4500,"resourceValue":"23","status":"success"},{"message":"L2_VNI 23001 is already allocated with MyNetwork_30010","resourceId":4501,"resourceValue":"23001","status":"failed"}]},"schema":{"properties":{"resources":{"description":"Response for Bulk Create resources request","items":{"properties":{"message":{"description":"Optional message details describing the resource create error","type":"string"},"resourceId":{"description":"Unique identifier of the resource","type":"integer"},"resourceValue":{"description":"unique identifier of the resource","type":"string"},"status":{"description":"status of the resource create request","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Partial succcess"},"400":{"description":"Bad Request","headers":{"Date":{"description":"Date","example":"Tue, 15 Nov 1994 08:12:31 GMT","schema":{"type":"string","example":"Tue, 15 Nov 1994 08:12:31 GMT","nullable":true},"$$ref":"#/components/headers/Date"},"Cache-Control":{"description":"Cache-Control","example":"no-cache, no-store, must-revalidate","schema":{"type":"string","default":"no-cache","nullable":true},"$$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"description":"Error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"},"errors":{"description":"An array of errors","type":"array","items":{"description":"Sub error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"}},"required":["message","code","description"],"example":{"message":"Invalid email","description":"The email you provided is invalid","code":4066},"$$ref":"#/components/schemas/SubError"}}},"example":{"message":"Unauthorized","description":"You are not authorized to access this resource","code":4065},"required":["message","code","description"],"$$ref":"#/components/schemas/Error"},"example":{"message":"Bad Request","description":"The server could not understand the request due to incorrect syntax.","code":400}}},"$$ref":"#/components/responses/400"},"401":{"description":"Unauthorized","headers":{"Date":{"description":"Date","example":"Tue, 15 Nov 1994 08:12:31 GMT","schema":{"type":"string","example":"Tue, 15 Nov 1994 08:12:31 GMT","nullable":true},"$$ref":"#/components/headers/Date"},"Cache-Control":{"description":"Cache-Control","example":"no-cache, no-store, must-revalidate","schema":{"type":"string","default":"no-cache","nullable":true},"$$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"description":"Error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"},"errors":{"description":"An array of errors","type":"array","items":{"description":"Sub error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"}},"required":["message","code","description"],"example":{"message":"Invalid email","description":"The email you provided is invalid","code":4066},"$$ref":"#/components/schemas/SubError"}}},"example":{"message":"Unauthorized","description":"You are not authorized to access this resource","code":4065},"required":["message","code","description"],"$$ref":"#/components/schemas/Error"},"example":{"message":"Unauthorized","description":"Indicates that the request requires user authentication information.","code":401}}},"$$ref":"#/components/responses/401"},"403":{"description":"Forbidden","headers":{"Date":{"description":"Date","example":"Tue, 15 Nov 1994 08:12:31 GMT","schema":{"type":"string","example":"Tue, 15 Nov 1994 08:12:31 GMT","nullable":true},"$$ref":"#/components/headers/Date"},"Cache-Control":{"description":"Cache-Control","example":"no-cache, no-store, must-revalidate","schema":{"type":"string","default":"no-cache","nullable":true},"$$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"description":"Error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"},"errors":{"description":"An array of errors","type":"array","items":{"description":"Sub error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"}},"required":["message","code","description"],"example":{"message":"Invalid email","description":"The email you provided is invalid","code":4066},"$$ref":"#/components/schemas/SubError"}}},"example":{"message":"Unauthorized","description":"You are not authorized to access this resource","code":4065},"required":["message","code","description"],"$$ref":"#/components/schemas/Error"},"example":{"message":"Forbidden","description":"The client does not have access rights to the content.","code":403}}},"$$ref":"#/components/responses/403"},"404":{"description":"Not Found","headers":{"Date":{"description":"Date","example":"Tue, 15 Nov 1994 08:12:31 GMT","schema":{"type":"string","example":"Tue, 15 Nov 1994 08:12:31 GMT","nullable":true},"$$ref":"#/components/headers/Date"},"Cache-Control":{"description":"Cache-Control","example":"no-cache, no-store, must-revalidate","schema":{"type":"string","default":"no-cache","nullable":true},"$$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"description":"Error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"},"errors":{"description":"An array of errors","type":"array","items":{"description":"Sub error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"}},"required":["message","code","description"],"example":{"message":"Invalid email","description":"The email you provided is invalid","code":4066},"$$ref":"#/components/schemas/SubError"}}},"example":{"message":"Unauthorized","description":"You are not authorized to access this resource","code":4065},"required":["message","code","description"],"$$ref":"#/components/schemas/Error"},"example":{"message":"Not Found","description":"The server cannot find the requested resource.","code":404}}},"$$ref":"#/components/responses/404"},"500":{"description":"Internal Server Error","headers":{"Date":{"description":"Date","example":"Tue, 15 Nov 1994 08:12:31 GMT","schema":{"type":"string","example":"Tue, 15 Nov 1994 08:12:31 GMT","nullable":true},"$$ref":"#/components/headers/Date"},"Cache-Control":{"description":"Cache-Control","example":"no-cache, no-store, must-revalidate","schema":{"type":"string","default":"no-cache","nullable":true},"$$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"description":"Error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"},"errors":{"description":"An array of errors","type":"array","items":{"description":"Sub error object","type":"object","properties":{"message":{"description":"The message that can be displayed to the user","type":"string"},"description":{"description":"A detailed description or suggestions on how to correct the error","type":"string"},"code":{"description":"The error code","type":"integer"}},"required":["message","code","description"],"example":{"message":"Invalid email","description":"The email you provided is invalid","code":4066},"$$ref":"#/components/schemas/SubError"}}},"example":{"message":"Unauthorized","description":"You are not authorized to access this resource","code":4065},"required":["message","code","description"],"$$ref":"#/components/schemas/Error"},"example":{"message":"Internal Server Error","description":"The server encountered an unexpected condition that prevented it from fulfilling the request.","code":500}}},"$$ref":"#/components/responses/500"}},"security":[{"OAuth2":["fabric-admin","super-admin","designer"]}],"summary":"Allocates the ID or IP/Subnet resource on given pool. If the resource value is Specified in the request the same will be allocated","tags":["Resource Management"],"__originalOperationId":"createResource","method":"post","path":"/fabrics/{fabricName}/resources"}}