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

Add flag for IBM Cloud Sysdig and update the team management for IBM. #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

aqan213
Copy link
Contributor

@aqan213 aqan213 commented Nov 28, 2019

We found there are some different sysdig API response (i.e. the user email, dashboards ) in IBM sysdig and draios version.
For example:

  1. /api/users
    In IBM sysdig, the username in the API response is not the user email address but the value generated by IBM.
"users": [{
		"termsAndConditions": true,
		"timezone": "+00:00",
		"pictureUrl": "http://www.gravatar.com/avatar/9cfee1e1134b8a4c82883efc29ec4222",
		"customer": {
			"id": 22210,
			"name": "******",
			"accessKey": "******"
		},
		"oauth": false,
		"properties": {
			"resetPassword": true,
			"OpenID Connect profile id": "[email protected]",
			"iamId": "IBMid-310002BDRD",
			"openid": true,
			"IbmJwtProfileId": "******",
			"user_email_alias": "<USER_EMAIL>",
			"IbmJwt": true,
			"has_been_invited": true
		},
		"resetPassword": true,
		"additionalRoles": [],
		"teamRoles": [{
			"teamId": 10051,
			"teamName": "Monitor Operations",
			"teamTheme": "#7BB0B2",
			"userId": 10713,
			"userName": "d869e779aa******[email protected]",
			"role": "ROLE_TEAM_MANAGER",
			"admin": true
		}],
		"lastUpdated": 1574152543000,
		"accessKey": "*****",
		"version": 15,
		"id": 10713,
		"enabled": true,
		"lastSeen": 1574052462000,
		"products": ["SDC"],
		"username": "d869e779aa*******[email protected]",
		"status": "confirmed",
		"systemRole": "ROLE_CUSTOMER",
		"firstName": "***",
		"lastName": "**",
		"dateCreated": 1573892567000
	}
  1. /api/teams
    In IBM sysdig , there are no userRoles in the response but just the "userCount"::
"teams": [{
		"version": 0,
		"description": "Immutable Monitor team with full visibility",
		"name": "Monitor Operations",
		"default": true,
		"properties": {},
		"id": 10051,
		"origin": "SYSDIG",
		"show": "host",
		"entryPoint": {
			"module": "Explore"
		},
		"theme": "#7BB0B2",
		"products": ["SDC"],
		"customerId": 22210,
		"dateCreated": 1573888882000,
		"lastUpdated": 1573888882000,
		"immutable": true,
		"canUseCustomEvents": true,
		"canUseAwsMetrics": true,
		"userCount": 1,
		"canUseSysdigCapture": true
	}]
  1. /api/v2/dashboards
    In both IBM sysdig and draios version, there are no isShared value but shared, also no annotations values.
{
               "customerId": 26132,
		"userId": 31929,
		"domain": null,   
                 *********** 
           
                "version": 1,
		"shared": true,
		"schema": 2,
		"name": "Overview by Process",
		"id": 135835,
		"public": false,
		"publicToken": null,
		"teamId": 23724,
		"autoCreated": true,
		"createdOn": 1572920429000,
		"username": "xxxx",
		"modifiedOn": 1572920429000,
		"favorite": false
    }
  1. the args of the function create_dashboard_from_view is not correct in kube_obj_parser.py.
    res = teamclient.create_dashboard_from_view(d, d, None, True, {'engineTeam': team_name + d, 'ownerUser': user})

The correct function is here and last argument is boolean type.

"def create_dashboard_from_view(self, newdashname, viewname, filter, shared=False, public=False):"

https://github.com/draios/python-sdc-client/blob/9b6a7fba636dbf0a73d65b59ceec4d7f16af97bc/sdcclient/_monitor.py#L645

@aqan213
Copy link
Contributor Author

aqan213 commented Nov 28, 2019

@davideschiera Can you please help to review this pull request for the IBM sysdig changes? Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant