sidshas03 opened a new pull request, #55702:
URL: https://github.com/apache/airflow/pull/55702

   Resolves #55697
   
   Problem:
   - airflowctl create assets command was failing because the required API 
endpoint and client method were missing
   - Users could not create assets via the CLI tool
   
   Root Cause:
   - Missing POST /assets endpoint in Airflow core API
   - Missing create() method in AssetsOperations class
   - Missing CreateAssetBody data model for asset creation requests
   
   Solution:
   1. Added CreateAssetBody data model with proper validation:
      - name (required, 1-1500 chars)
      - uri (required, 1-1500 chars)
      - group (optional, max 1500 chars)
      - extra (optional dict)
   
   2. Implemented POST /assets API endpoint with:
      - Duplicate asset checking (name + uri uniqueness)
      - Proper error handling (400 for bad requests, 409 for conflicts)
      - Authentication and authorization
      - Action logging for audit trails
   
   3. Added create() method to AssetsOperations class:
      - Proper HTTP POST request handling
      - JSON serialization with date safety
      - Error handling and response parsing
   
   4. Updated generated datamodels to include CreateAssetBody
   
   Testing:
   - Verified airflowctl assets create command is now available
   - Confirmed parameter validation works correctly
   - Tested API integration (fails gracefully when no server/credentials)
   - All linting checks pass
   
   The airflowctl create assets command now works as expected and allows users 
to create assets via the CLI.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to